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
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.
I have this table and I want to filter the “system” column by clicking on the “arrow” on the right corner:
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:
Back on the “system” column, I will select “equals” option:
By clicking on the “equals”, I will get the same options than I have before to select this option:
On the “empty” fields, I can put manually what I want to filter or by clicking on the “arrow”, I will get a list:
On this popup, I can add only another criteria but if I want to add more, I will click on the “advanced”:
I can click on “add clause” to add a third condition, a fourth one, etc. Once done, I will click on “close & apply”:
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:
I get this result:
Not what I want so combining both columns:
I get the desired result:
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...