To delete rows in Power BI, you must use the Power Query Editor to filter out the data you do not want; you cannot simply right-click a row in the report view and hit delete. Because Power BI is a data visualization tool rather than a spreadsheet, it treats data as a stream. To "delete" a row, you create a rule that tells Power BI to ignore specific records during the data loading process, ensuring that only the relevant information reaches your dashboards.

What You'll Need

  • A Power BI Desktop installation on your computer.
  • A dataset already loaded into your Power BI model.
  • Administrative permissions to edit the data transformations of the report.

Step-by-Step

  1. Open Power Query Editor: From the main Power BI Desktop interface, go to the Home tab on the top ribbon. Locate the "Data" section and click on the Transform Data button. This will open the Power Query Editor in a new window. Note that menu labels may vary slightly depending on your specific version of Power BI Desktop.
  2. Select Your Table: In the left-hand Queries pane, click on the specific table that contains the rows you wish to delete. The data will appear in the central preview window.
  3. Identify the Rows to Remove: Depending on your goal, there are three primary ways to remove rows:
    • Manual Filtering: Click the drop-down arrow in the header of the column that contains the unique identifier for the row you want to remove. Uncheck the boxes next to the specific values you want to exclude.
    • Remove Top/Bottom Rows: If you have header or footer noise (like empty rows at the start of a CSV), go to the Home tab in the Power Query ribbon, click Remove Rows, and select Remove Top Rows. Enter the number of rows to strip from the top of the table.
    • Remove Duplicates: If you have redundant data, right-click the column header (or select multiple columns using Ctrl) and select Remove Duplicates.
  4. Apply Conditional Logic: For larger datasets where manual unchecking is impossible, click the drop-down arrow on a column and select Text Filters or Number Filters. Choose a condition such as "Does Not Equal" and type in the value you want to delete. This creates a dynamic rule that will remove any future rows matching that criteria.
  5. Remove Blank Rows: If your table contains empty records, go to the Home tab, click Remove Rows, and select Remove Blank Rows. Power BI will scan the entire table and delete any row where every single cell is empty.
  6. Verify the Change: Look at the Applied Steps pane on the right side of the screen. You should see a new step labeled "Filtered Rows" or "Removed Duplicates." This confirms the action has been recorded.
  7. Save and Apply: Once the unwanted rows are gone, click Close & Apply in the top-left corner of the Power Query Editor. Power BI will now reload the data into the model, excluding the rows you filtered out.

Common Mistakes

One of the most frequent errors users make is attempting to delete rows directly from the Data View (the table icon on the far left of the main screen). Many users try to select a row and press the delete key on their keyboard, but this does nothing. Power BI is not an Excel sheet; it is a read-only view of the data processed by Power Query. Any structural change to the data must happen inside the Transform Data window.

Another common mistake is using "Remove Top Rows" without ensuring the data is sorted. If your data source is dynamic and the order of rows changes upon refresh, "Remove Top 5 Rows" might delete five perfectly valid records tomorrow that were not the "noise" rows today. Always apply a Sort operation to your data before using positional row removal to ensure consistency.

Users also often forget to check the Applied Steps pane. If you delete rows and then realize you deleted too many, you might try to undo the action using Ctrl+Z. However, Ctrl+Z does not work for data transformations in Power Query. You must click the small red "X" next to the specific step in the Applied Steps list to revert the deletion.

Tips

To maintain a clean and performant report, prefer Filtering over manual row deletion. When you use a filter (e.g., "Column X does not equal 'Error'"), Power BI creates a reusable logic step. If your data source is updated next month with new 'Error' rows, Power BI will automatically delete them during the refresh process without you having to go back into the editor.

If you need to remove rows based on complex criteria involving multiple columns, use the Add Column tab to create a "Conditional Column." For example, you could create a column that marks a row as "Keep" or "Delete" based on a combination of date and value. Once the conditional column is created, simply filter that column to only show "Keep" and then delete the helper column before clicking Close & Apply.

For very large datasets, removing rows early in the "Applied Steps" sequence is better for performance. The earlier you filter out unwanted data, the less memory Power BI uses for subsequent transformations, which leads to faster refresh times and a smaller file size.

Troubleshooting

If the rows reappear after a refresh: This usually happens because you used a manual selection filter instead of a logic-based filter. Check your Applied Steps. If the step says "Filtered Rows" but you only unchecked a few boxes, any new data added to the source that wasn't unchecked will appear. Use a "Does Not Equal" filter instead.

If the "Remove Blank Rows" option is greyed out: This occurs if Power BI does not recognize the table as having a consistent schema or if the table is currently empty. Ensure you have loaded the data correctly and that the table is selected in the Queries pane.

If you accidentally deleted the wrong data: Do not panic and do not close the Power Query window. Look at the Applied Steps pane on the right. Find the step where you performed the deletion (usually named "Filtered Rows"). Click the red X icon to the left of that step name. This will instantly restore the deleted rows to the preview.

If the report is slow after removing rows: Sometimes, complex filters can slow down the query. Try moving the "Remove Rows" step as high as possible in the Applied Steps list. This ensures that the data is reduced in size before Power BI attempts to perform more resource-intensive operations like merging or pivoting.

Frequently Asked Questions

Can I delete a row in Power BI and have it be deleted from my original Excel file?

No. Power BI is a one-way street. It reads data from your source but cannot write back to it. Deleting a row in Power Query only removes it from the Power BI model; the original Excel, SQL, or CSV file remains unchanged.

What is the difference between "Remove Rows" and "Filtering"?

"Remove Rows" typically refers to positional deletions (like removing the first 10 rows). "Filtering" refers to logic-based deletion (removing rows where the city is 'New York'). Filtering is generally safer for dynamic datasets.

How do I delete rows that contain errors?

In the Power Query Editor, go to the Home tab, click Remove Rows, and select Remove Errors. You can also right-click a specific column and choose Remove Errors to target only issues in that particular field.

Can I delete rows based on a date range?

Yes. Click the drop-down arrow on your Date column, select Date Filters, and choose a range (e.g., "Between" or "After"). Any dates falling outside your chosen range will be effectively deleted from the dataset.

Does deleting rows reduce the file size of my .pbix file?

Yes. Because Power BI uses a columnar compression engine, removing unnecessary rows reduces the amount of data stored in memory, which results in a smaller file size and faster report performance.

Is there a way to delete rows using DAX?

DAX cannot delete rows from a table. DAX is used for calculations and creating virtual tables. To permanently remove data from the model, you must use Power Query (M language) during the data transformation phase.