Power Query Blank: Remove Blanks and Empty Rows
In this article
Power Query leaves blank rows, null cells, or empty columns when your source has gaps, and the fix depends on what you mean by "blank." To remove entirely empty rows or columns, use Home > Remove Rows > Remove Blank Rows (or Remove Columns > Remove Empty Columns). To replace nulls with a value, use Transform > Replace Values with null as the value to find. To filter out blanks in one column, use the column filter dropdown and clear (Blanks). The steps below cover each case, plus how to keep blanks that matter, such as a blank category that legitimately means "unassigned."
What You'll Need
- Power Query Editor open on a query (in Excel: Data > Get Data, or Data > Queries & Connections; in Power BI Desktop: Transform Data).
- A clear idea of whether a blank means missing data, an empty row, or a valid empty value you want to keep.
- Optional: a backup copy of the workbook or report before you change the query, since query steps are saved and reapplied on refresh.
Step-by-Step
- Load the query into Power Query Editor. In Excel, select any cell in your table and go to Data > From Table/Range. In Power BI Desktop, select Transform Data. The Power Query Editor opens with your data in the preview grid. Menu labels can differ slightly by version, device, or region, so if a button name is not exactly as written here, look for the closest match in the same ribbon tab.
- Identify what is actually blank. In Power Query, a blank cell is usually null, not an empty string. Click a cell that looks empty and check the formula bar or the cell's value: null is shown as null, while an empty string shows as two quotes with nothing between them. This matters because different tools treat them differently. If your source is a CSV, blanks often arrive as null; if it is an Excel table, they may arrive as null or as empty text depending on the column type.
- Remove entirely empty rows. On the Home tab, select Remove Rows > Remove Blank Rows. Power Query removes only rows where every column is blank. If a row has one filled cell and the rest blank, it stays. This is the safest bulk clean-up and should be your first move when a report has trailing empty rows.
- Remove entirely empty columns. On the Home tab, select Remove Columns > Remove Empty Columns. This drops columns where every row is blank. Use it when an export includes placeholder columns you do not need.
- Filter blanks out of one column. Select the dropdown arrow on the column header and clear the checkbox next to (Blanks). The preview updates immediately. This is the right approach when blanks in a specific column, such as CustomerID, mean the row is unusable, even if other columns have data.
- Replace nulls with a value. Select the column, then go to Transform > Replace Values. Enter null in the Value To Find box (type the word null, not the text "blank") and your replacement in Replace With, such as 0, "Unknown", or "Unassigned". Use this when you want to keep the row but give the blank a meaningful label.
- Fill blanks down from the row above. If your data is a report-style layout where a category appears once and then blank rows follow, select the column and use Transform > Fill > Down. This copies the last non-blank value into the blanks below it. Only use Fill Down when the blank genuinely means "same as above"; otherwise you will invent data.
- Check data types before and after. A column typed as Whole Number cannot hold text replacements like "Unknown" without an error. If Replace Values fails, change the type first: select the column, then use the data type dropdown on the Home tab (for example, change to Text), do the replacement, and set the type back if needed. Errors from type mismatches appear as Error in cells, which you can inspect by clicking the cell.
- Review the Applied Steps. Each action you take is recorded in the Applied Steps list on the right. Click any step to preview the data at that point. If a step did something unexpected, delete it with the X next to its name. This is the fastest way to undo a bad clean-up without starting over.
- Close and load. In Excel, select Close & Load (or Close & Load To to choose a destination). In Power BI Desktop, select Close & Apply. The cleaned data loads, and the steps reapply every time the query refreshes.
Common Mistakes
- Assuming every blank is null. Empty text ("") and null behave differently in filters and replacements. If a filter for (Blanks) does not catch your empty cells, the column likely contains empty strings. Replace "" with null first, or filter on the empty string directly.
- Removing blank rows too early. If you remove blank rows before filling down or merging columns, you may delete rows that only looked empty because a value was in a column you had not loaded yet. Clean in this order: fix types, fill or replace, then remove.
- Using Fill Down on unordered data. Fill Down copies the value above. If the rows are not sorted so that the category sits directly above its blanks, you will attach the wrong value. Sort first or use a different method.
- Forgetting that steps persist. Removing blank rows is saved in the query. On refresh, new blank rows from the source are removed too. That is usually what you want, but confirm it before you rely on the query for reporting.
- Replacing nulls in a numeric column with text. This triggers type errors. Change the column type to Text before replacing with words, or replace with 0 if the column must stay numeric.
Tips
- Use the preview grid's column quality indicator (View tab, Column Quality) to see the percentage of valid, error, and empty values per column before you clean. It shows at a glance which columns are the problem.
- Rename your steps in Applied Steps to describe what they do, such as "Remove blank rows" or "Fill category down". Future you will thank you.
- If you only need to hide blanks in a visual, filter in the report instead of the query. Keeping the rows in the model preserves totals and relationships.
- When replacing nulls, consider whether 0 or "Unknown" is more accurate. A blank quantity often means zero; a blank category usually means unknown. Choosing the wrong one skews averages and counts.
- For repeating clean-up, save the query as a template or copy the Applied Steps to a new query rather than rebuilding them each time.
Troubleshooting
- The (Blanks) filter option is missing. The column may have no blanks at all, or the preview has not refreshed. Click Refresh Preview on the Home tab. If it still does not appear, the empty cells are likely empty strings, not nulls; filter on the empty string instead.
- Remove Blank Rows did nothing. The rows are not fully blank; at least one column has a value, often a space character or a zero. Filter each column for blanks to find the culprit, or trim the column with Transform > Format > Trim to remove stray spaces.
- Replace Values returns errors. The column type does not accept the replacement. Change the type to Text, replace, then set the intended type. If errors persist, check for leading or trailing spaces in the values you are matching.
- Blanks reappear after refresh. The source still contains them and your steps do not cover them, for example because new rows were added below where your filter applied. Add a step that handles blanks generically, such as Remove Blank Rows, rather than deleting specific rows.
- The query is slow after cleaning. Too many steps on large data can slow refresh. Combine steps where possible, remove unused columns early, and filter rows before doing heavy transformations.
Frequently Asked Questions
What is the difference between null and blank in Power Query?
Null means no value at all. Blank usually refers to a cell that looks empty, which can be null or an empty text string. Filters and replacements treat them differently, so check the cell value before choosing a method.
How do I remove rows where one specific column is blank?
Use the column's filter dropdown and clear (Blanks). That removes rows where that column is blank, even if other columns have data. Remove Blank Rows is different: it only removes rows where every column is blank.
Can I replace blanks with zero in a number column?
Yes. Select the column, use Transform > Replace Values, enter null as the value to find, and 0 as the replacement. Keep the column type as Whole Number or Decimal Number.
Why does Fill Down give wrong values?
Fill Down copies the last non-blank value above. If the rows are not sorted so the correct value sits directly above the blanks, the wrong value is copied. Sort the data first or use a lookup instead.
Do these steps apply in both Excel and Power BI?
The Power Query Editor is the same engine in both. Ribbon labels and the close/load buttons differ slightly, but Remove Blank Rows, Remove Empty Columns, Replace Values, and Fill Down work the same way.
Will removing blank rows break my relationships in Power BI?
It can if the removed rows held key values other tables depend on. Remove blanks only from columns that are not used as relationship keys, or replace the blanks instead of deleting the rows.