Power BI: filter before loading data

There are many reasons to filter the data source before to load in Power BI, I can use this feature for instance:

  • To load small data from a big data source
  • To remove all empty cells from a small data source
  • To load specific data instead to load everything
  • Etc.

In the other hand, I can also use this feature when my data source is becoming too big. For instance, at the beginning, my data source was very small and currently, it is very big. What I want to say, it is that I don’t need to use this feature at the beginning of everything but much more later too.

When I open the first time Power BI to load data, I have this popup with those options:

  • If I click on “load”, it will load my data as it is
  • If I click on “cancel”, no need to explain
  • If I click on “transform data”, this is the option I want
power bi

By clicking on it, I will go the “Power Query Editor” or “editor” interface. Now, let´s take the other scenario, for instance, my data is becoming too big. In this case, I will click on “home -> transform data -> transform data” and I will go to the “editor” interface.

power bi

I have this table and I want to filter the “system” column by clicking on the “arrow” on the right corner:

power bi power bi

I have the option to “remove empty” cells or by clicking on the “text filters”, I have more options. Based on the type of data of my column, “text filters” will be replaced by other thing, for instance, the “id” column is a number data type:

power bi

Back on the “system” column, I will select “equals” option:

power bi

By clicking on the “equals”, I will get the same options than I have before to select this option:

power bi

On the “empty” fields, I can put manually what I want to filter or by clicking on the “arrow”, I will get a list:

power bi

On this popup, I can add only another criteria but if I want to add more, I will click on the “advanced”:

power bi

I can click on “add clause” to add a third condition, a fourth one, etc. Once done, I will click on “close & apply”:

power bi

From now on, instead to load all data from my source, Power BI will only load the data I want. Now, there is a trick, sometimes to get the result I want, I need to combine multiple columns in the same filter. For example, from my source, in the “group” column, I want to load data to not contain “IT” and “HR” except for “NT” and “unix” so doing the filter like this:

power bi

I get this result:

power bi

Not what I want so combining both columns:

power bi

I get the desired result:

power bi

Interesting Topics