Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query Remove Null Rows: Step-by-Step Guide

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To remove null rows in Power Query, you filter out nulls from the column that should always have a value. The quickest way: click the filter arrow on that column header, clear the (null) checkbox, and click OK. This removes every row where that column is null. If you need to remove rows where any column is null, you can filter each column in turn or use a custom column to flag rows with any nulls and then filter that flag. The steps below cover both approaches, plus the pitfalls that cause missing data after a refresh.

What You'll Need

  • Power Query Editor open, either in Excel (Data > Get Data) or Power BI Desktop (Transform data).
  • A query already loaded with your data. If you are starting fresh, use Data > Get Data > From Table/Range or connect to your source first.
  • A clear idea of which column must never be empty. That column is your filter key.

Menu labels can differ slightly by version, device or region. The steps below use the Power Query Editor in Excel and Power BI Desktop; the same commands exist in both, though the ribbon layout may vary.

Step-by-Step

  1. Open the Power Query Editor. In Excel, select any cell in your table and go to Data > Get Data > Launch Power Query Editor. In Power BI Desktop, go to Home > Transform data. The editor opens in a separate window.
  2. Select the query. In the Queries pane on the left, click the query that contains the null rows. If you have only one query, it is already selected.
  3. Find the column to filter. Scroll the data preview to the column that should always contain a value, such as an ID, name, or date. Click its column header to select it.
  4. Open the filter menu. Click the small filter arrow at the right side of the column header. A dropdown list appears with checkboxes for each distinct value.
  5. Clear the (null) checkbox. In the list, uncheck (null). Leave the other values checked. If the list is long, use the search box at the top of the dropdown to find (null) quickly.
  6. Click OK. Power Query removes every row where that column is null. The step appears in the Applied Steps pane on the right as "Filtered Rows."
  7. Check the row count. Look at the status bar at the bottom of the editor. It shows the number of rows before and after the filter. If the count drops more than expected, you filtered the wrong column or removed rows that had valid data in other columns.
  8. Remove rows where any column is null (optional). If you need to drop rows that have a null in any column, add a custom column: go to Add Column > Custom Column, name it something like "HasNull," and enter a formula such as List.Contains(Record.FieldValues(_), null). This returns true if any field is null. Then filter that new column to keep only false. Remove the helper column afterward with Home > Remove Columns.
  9. Apply and close. In Excel, click Home > Close & Load to load the cleaned data to a worksheet or the Data Model. In Power BI Desktop, click Home > Close & Apply. The query now excludes null rows each time it refreshes.

Common Mistakes

  • Filtering the wrong column. Removing nulls from a column that is allowed to be empty can delete valid rows. Always filter the column that must have a value, such as a primary key.
  • Assuming null and blank are the same. Power Query treats null and empty text ("") differently. A filter that removes nulls will not remove empty strings. To remove both, filter out null and then filter out empty values, or use a custom column to test for both.
  • Forgetting that filters apply to the current step. If you add a filter after other steps, it applies to the data as it exists at that point. If a later step changes values, the filter will not re-run automatically. Check the Applied Steps order.
  • Not refreshing after source changes. The filter is saved in the query, but new null rows in the source will be removed only when the query refreshes. In Excel, refresh with Data > Refresh All. In Power BI, use Home > Refresh.
  • Using Remove Rows > Remove Blank Rows instead. That command removes rows where all columns are blank, not rows where a specific column is null. It is a different operation and may leave rows you wanted gone.

Tips

  • Rename the filter step in Applied Steps to something clear, like "Remove null IDs," so you remember why it is there.
  • Use the column quality indicator under View > Column quality to see how many nulls each column contains before filtering. This helps you choose the right column.
  • If you need to keep null rows for some reports but remove them for others, duplicate the query and apply the filter only to the copy.
  • For text columns, consider replacing nulls with a placeholder value (Transform > Replace Values) instead of removing rows, if the row has other useful data.
  • When combining tables, remove nulls after the append or merge, not before, so you do not lose rows that would have matched later.

Troubleshooting

If the filter does not remove the rows you expect, check these in order:

  • The step is in the wrong place. In Applied Steps, click the step before the filter and inspect the data. If the nulls appear only after a later step, move the filter down by deleting and re-adding it after that step.
  • The values are empty strings, not nulls. Click the filter arrow and look for a blank entry. If you see an empty checkbox instead of (null), the cells contain "". Filter that out separately.
  • The column type changed. If a column was converted to text, numbers that were null may now show as "null" text. Check the column type icon in the header and set it correctly with Transform > Data Type.
  • The query did not refresh. After closing and loading, refresh the data. If new null rows appear, the filter is working only on the old snapshot.
  • You filtered a step that is not the last one. If a later step re-adds rows (for example, an append), the nulls can come back. Apply the filter after the append.

If none of that works, delete the filter step and recreate it from the column header. A corrupted step is rare but possible; recreating it is faster than debugging.

Frequently Asked Questions

Can I remove null rows from multiple columns at once?

Not with a single filter click. You can filter each column in turn, or add a custom column that checks all columns for nulls and filter that helper column. The helper approach is faster for wide tables.

Does removing null rows affect the original data source?

No. Power Query changes only the query output. The source file or database is untouched. You can always delete the filter step to restore the rows.

What is the difference between null and blank in Power Query?

Null means no value at all. Blank usually means an empty text string ("") or a cell that looks empty but contains a space. Filters treat them separately, so you may need to remove both.

Will the filter apply to new data when I refresh?

Yes. The filter is part of the query, so every refresh re-applies it to the current source data. New null rows will be removed automatically.

Can I remove null rows only from a specific column while keeping nulls in others?

Yes. Filter only the column you care about. Rows with nulls in other columns remain as long as the filtered column has a value.

Why does my row count not change after filtering?

Either the column has no nulls, or the nulls are stored as empty strings. Check the filter dropdown for a blank entry and the column data type.