Row Filtering in Power BI and Power Query: Remove Blank Rows Vs. Remove Empty

Remove Blank Rows Vs. Remove Empty in Power BI and Power Query

When you have blank values in your data table, you can use Power Query transformations to remove the row with blank values. There are two transformations that are used very often for this purpose: Remove Empty and Remove blank rows. These two transformations are not exactly the same. In this article, I’ll explain what is their differences.


Sample Data

Let’s assume that we have a table with the sample data below;

Sample data table

There are two rows in the data table above that include blank values. the very first and the very last row of the table.

Power Query Editor

To remove the rows with blank values, you can click on the Transform Data and get the Power Query Editor window opened.

Transform data in Power BI

Remove Empty

Remove Empty is a transformation that you can choose by clicking on the drop down on the column header;

Remove Empty in Power Query

This option, removes the entire row if the value of that row in the selected column is blank. This means values in other columns is not considered at all, they might have a value or they might be blank.

How Remove Empty works in Power Query and Power BI

In the example above, the last rows, which was entirely blank, and also the first row, which was not blank in the Column1, but it was blank in the Column2 (which was the column we used the Remove Empty on it), both removed.

Remove Empty only considers the value in the selected column to be empty

Remove Blank Rows

If you want to remove the row only if all values (across all columns) are empty, then Remove Blank Rows is a better option. You can find it under Remove Rows.

Remove Blank Rows in Power Query

This option, will check the value in every single cell of that row, and will remove the row if all of those values are blank. For this operation, it doesn’t matter what column you have selected, the output will be like this:

How the Remove Blank rows works in Power Query and Power BI

Column-dependent transformations

As you realized, for some of the transformations in Power Query, the selected column is important. We can call them column-dependent transformations. Some of the examples of these transformations are;

  • Remove Empty
  • Replace Error
  • Replace Value

There are also some transformations, which for them, the selected column doesn’t matter. Or we can call them Column-independent transformations. Here are some of those transformations;

  • Remove Blank Rows
  • Remove Top/Bottom/Alternate Rows
  • Keep Top/Bottom/Range of Rows

And there are some transformations that depend on the context, can apply to a column or the whole table. Such as below list;

There is no right or wrong transformation in the lists above. Each of the transformations above can be useful in a specific scenario. You need to choose the right transformation for the given requirement.

Reza Rad on FacebookReza Rad on LinkedinReza Rad on TwitterReza Rad on Youtube
Reza Rad
Trainer, Consultant, Mentor
Reza Rad is a Microsoft Regional Director, an Author, Trainer, Speaker and Consultant. He has a BSc in Computer engineering; he has more than 20 years’ experience in data analysis, BI, databases, programming, and development mostly on Microsoft technologies. He is a Microsoft Data Platform MVP for 12 continuous years (from 2011 till now) for his dedication in Microsoft BI. Reza is an active blogger and co-founder of RADACAD. Reza is also co-founder and co-organizer of Difinity conference in New Zealand, Power BI Summit, and Data Insight Summit.
Reza is author of more than 14 books on Microsoft Business Intelligence, most of these books are published under Power BI category. Among these are books such as Power BI DAX Simplified, Pro Power BI Architecture, Power BI from Rookie to Rock Star, Power Query books series, Row-Level Security in Power BI and etc.
He is an International Speaker in Microsoft Ignite, Microsoft Business Applications Summit, Data Insight Summit, PASS Summit, SQL Saturday and SQL user groups. And He is a Microsoft Certified Trainer.
Reza’s passion is to help you find the best data solution, he is Data enthusiast.
His articles on different aspects of technologies, especially on MS BI, can be found on his blog:

Leave a Reply