How to Remove a Row in Power BI
Cleaning up your data is one of the most important steps in building a reliable Power BI report, and sometimes that means getting rid of rows you don’t need. Whether it’s test data, irrelevant entries, or plain old errors, removing unwanted rows can make your final visualizations cleaner and more accurate. This guide will walk you through several easy and effective methods to remove rows in Power BI using the Power Query Editor.
Why Would You Need to Remove Rows?
Before jumping into the "how," it's helpful to understand the "why." You’re not just deleting data for the sake of it. Clean, relevant data leads to trustworthy reports. Here are a few common scenarios where you'll find yourself needing to remove a few rows:
Cleaning Up Test Data: Your team might have run a few test orders in Shopify or created some sample deals in Salesforce. These entries are great for testing but will skew your actual performance metrics if left in your dataset.
Removing Irrelevant Entries: You might want to exclude data from internal employee activity on your website (tracked in Google Analytics) or remove sales data from a country you no longer serve.
Fixing Data Entry Mistakes: Sometimes, incomplete or mistaken entries are created. Removing these rows is often easier than trying to fix them, especially if they are duplicates or lack critical information.
Filtering Outliers: A single, anomalous data point — like a $1 million sale when all other sales are under $1,000 — could be a typo or a special case you want to exclude from your standard analysis to avoid distorting your charts.
In all these cases, the goal is the same: to create a dataset that accurately reflects the business activity you want to analyze. The best place to handle this kind of data cleaning in Power BI is in the Power Query Editor.
The Easiest Method: Using Filters in Power Query
The Power Query Editor is the data transformation engine room of Power BI. It's where you shape, clean, and prepare your data before it gets loaded into your report model. Using the built-in filter functions is the most direct and common way to remove specific rows.
Let’s say you have some website traffic data, but you want to remove all traffic attributed to "Internal" sources. Here’s how you’d do it step-by-step.
Step 1: Open the Power Query Editor
From your main Power BI Desktop window, go to the Home tab on the top ribbon and click on Transform data. This will launch the Power Query Editor in a new window.
Step 2: Select Your Table
On the left side of the Power Query Editor, you’ll see a list of your queries (which are your tables). Click on the table you want to edit. In our example, we'll choose the "Website Traffic" table.
Step 3: Filter the Column
Find the column that contains the value you want to filter by. In this case, it's the Campaign Source column. Click the little dropdown arrow on the column header.
A dropdown menu will appear showing a list of all unique values in that column. Simply uncheck the box next to the value you want to remove. Here, we'll uncheck "Internal."
Step 4: Click OK and Apply Changes
Click OK. You'll instantly see all rows where Campaign Source was "Internal" disappear from the preview. Power Query has recorded this as a "Filtered Rows" step on the right-hand side under Applied Steps.
Finally, to save your changes and load the cleaned data into your report, click Close & Apply in the top-left corner of the Power Query Editor.
This same basic filtering method works for any type of data, whether it’s text, numbers, or dates. Just click the column header and uncheck what you don’t want.
Removing Rows Based on Multiple Conditions
Sometimes, your requirement is a bit more complex. You might need to remove rows based on the values in two or more columns. For instance, what if you need to remove rows only where the Campaign Source is "Organic Search" and the Sessions count is less than 5?
Power Query handles this easily.
First, apply a filter to the
Campaign Sourcecolumn and select only "Organic Search".Next, go to the
Sessionscolumn, click the filter dropdown, and choose Number Filters > Less Than...In the dialog box that appears, enter 5 and click OK.
At this point, you've isolated the rows you want to remove. But wait — how do you actually remove them? The trick here is to think in reverse. Instead of selecting what you want to remove, you build a view of everything you want to keep.
A better way to phrase this task would be: "Keep all rows, except those where Campaign Source is 'Organic Search' and Sessions are less than 5."
Using the Advanced Filter
A cleaner way to set multiple conditions is with the advanced filter. Let’s try to remove rows where Country is "USA" or where Status is "Test".
Head back to the Power Query Editor.
This time we're taking a different approach. Right click the row(s) you want to remove and select Remove Rows.
Deleting a Range of Rows
Sometimes your cleanup task isn't based on a value but on a row's position. This often happens with poorly formatted CSV or Excel exports that include extra, unnecessary rows at the top or bottom of the file.
Power BI has dedicated functions for this in the Power Query Editor ribbon. In the Home tab, find the Remove Rows button.
1. Remove Top Rows
Let's say your report export has two rows of header fluff — a title and an export date — before the actual column headers. You can tell Power BI to just skip them.
Click Remove Rows > Remove Top Rows.
A small box will pop up asking for the number of rows to remove. Enter 2 and click OK.
The top two rows of your dataset are now gone. You'll likely need to use the Use First Row as Headers button (also in the Home tab) afterward to promote your real headers.
2. Remove Bottom Rows
This works the same way but in reverse. If an export contains summary totals or a footer at the bottom, you can easily chop them off.
Click Remove Rows > Remove Bottom Rows.
Enter the number of summary rows at the end of your file and click OK.
These functions are incredibly useful for cleaning up automated reports that aren't formatted as clean data tables.
Removing Blank Rows or Rows with Errors
Errors and blanks can cause problems in your calculations and look unprofessional in your visuals. Power Query makes getting rid of them a one-click process.
Removing Errors
If there's a data type mismatch (e.g., text in a number column) or another issue, Power BI will flag it as an "Error". These can break your report refreshes or calculations.
Go to the Home tab in the ribbon.
Click Remove Rows > Remove Errors.
That's it. Power Query will scan your entire table and remove any row that contains an error in any cell.
Removing Blank Rows
Handling blanks can be done in two ways depending on your needs.
Method 1: Filter Blanks in a Specific Column
Often, you only care if a specific essential field is blank. For example, a sales record without a Product SKU is useless. To remove these:
Click the filter dropdown on the
Product SKUcolumn.Uncheck the box next to (null) or (blank).
Click OK.
This removes only the rows that are blank in that one important column.
Method 2: Remove Entirely Blank Rows
Sometimes, your source data has totally empty rows separating sections of data. To remove these:
Go to Remove Rows > Remove Blank Rows.
This function removes any row where every single cell in that row is null. Be careful, as this is different from Method 1. It won't remove a row that has a blank in one column but data in another.
Using DAX to Exclude Rows (A Different Approach)
Everything we’ve done so far in the Power Query Editor permanently removes the rows from your dataset when you click "Close & Apply." But what if you want to keep the data in your model but just hide certain rows in a specific chart or on a particular page?
This is where DAX and the Filters pane in Power BI's Report View come in handy. This method doesn't remove the data, it just filters it out of the visuals.
For example, you could show a sales report to your entire team but want to filter out a specific high-value customer when showing it to a certain audience.
In the main Power BI report canvas, select the chart or table you want to filter.
Go to the Filters pane (usually on the right).
Drag the field you want to filter by (e.g.,
Customer Name) into the "Filters on this visual" well.Change the "Filter type" to Basic filtering and uncheck the name of the customer you want to temporarily hide.
This approach gives you flexibility because the data is still available for other calculations or visuals. The downside is that your dataset is larger in size, as the data hasn't been permanently removed. For permanent data cleaning and optimization, always use Power Query.
Final Thoughts
Mastering how to remove rows is a fundamental part of preparing clean, reliable data for your reports. Power Query is your go-to tool for these tasks, allowing you to filter out specific values, delete ranges of rows, and clean up errors or blanks before the data ever hits your visuals. For more dynamic, temporary filtering, you can use the Filters pane directly in your report.
All these powerful data transformation steps are essential, but they can still add up to a lot of manual work, especially when you're connecting many different data sources. We've simplified this entire process. Instead of navigating menus and applying manual steps to clean your data, Graphed allows you to just describe what you want in plain English. You can simply ask, "Show me last quarter's Shopify revenue by marketing campaign, but exclude any test orders," and our AI-powered analyst instantly builds a live dashboard with the data already cleaned and filtered, getting you to the insights you need in seconds, not hours.