Power Bi Tutorial - Power BI Filters Tutorial
Posted by Superadmin on August 20 2020 15:17:23

Power BI Filters Tutorial

 


The following power bi tutorial section explains you about the types of Filters with a practical example

  1. Slicer
  2. Basic Filters
  3. Advanced Filters
  4. Top N Filters
  5. Filters on Measures
  6. Page Level Filters
  7. Report Level Filters
  8. Drill through Filters

 

Power BI Slicer

 

Power BI Slicer is commonly used to add filters to the canvas or to display filters on the report canvas. Let me show you how to Create a Slicer in Power BI with an example.

 

For this Power BI Slicer demonstration, we are going to use the SQL Data Source that we created in our previous article. So, Please refer to Connect Power BI to SQL Server article to understand the Power BI Data Source.

How to Create a Power BI Slicer

We are going to use this page to demonstrate the steps involved in creating a Power BI Slicer. This page contains Stacked Bar ChartClustered Column Chart, and Pie Chart.  

 

Power BI Slicer 1

To create a Slicer in Power BI, first Drag and Drop the fields that you want to use as a filter to the Canvas region.

In this example, we want to use Country as the Filter for this report. So, let me drag the Country from the Geography table to the Canvas. It will automatically create a Map for you.

  Power BI Slicer 2

Click on the Slicer under the Visualization section. It will convert a Map into Slicer. From the screenshot below, you can see the list of countries.

Power BI Slicer 3

Create a Power Bi Slicer Approach 2

First, click on the Slicer under the Visualization section. It automatically creates a Slicer with dummy data, as shown below.

Power BI Slicer 4

In order to add data to a Slicer, please drag and drop the filter field to the Fields section. Let me add Country to the Fields section.

Power BI Slicer 5

For the demo purpose, let me select the United States. From the screenshot below, you can see that the Stacked Column chart, Pie Chart, and Clustered Column charts are displaying the Sales for the united states.

TIP: By default, you can only select One field (Country) at a time. For multiple select, you have to toggle Single Select option from On to Off in the format section.

Power BI Slicer 6

This time we selected the United Kingdom. From the screenshot below, you can see that the filter applied on all charts.

Power BI Slicer 7

How to Format Power BI Slicer

Please click on the Format button to see the list of formatting options that are available for this Power BI Slicer.

Power BI Slicer 8

Format Power BI Slicer General Settings

Use this General Section to Change the Outline Weight, Outline Color, X, Y position, Width, and height of a slicer

Power BI Slicer 9

Format Header of a Slicer in Power BI

As you can see from the screenshot below, we added Background Color, Outline to bottom. Next, we changed the text size to 20, and Font family to Georgia.

Power BI Slicer 10

Format Power BI Slicer Items

We changed the Items (Countries) font color to Green, text size to 20, and Font family to Georgia. 

 

Power BI Slicer 11

Format Slicer Title

By toggling the Title option from Off to On, you can add a title to the Slicer.

From the screenshot below, you can see we added the Title Text as Countries Slicer in Power BI. Next, change the Font Color to Red, Title Alignment to center, Font Family to Georgia, and Text Size to 19.

Power BI Slicer 12

Format Power BI Slicer Background Color and Borders

You can add the Background color to a slicer by toggling Background option to On. For the demonstration purpose, we added a random color with 66% transparency.

Similarly, you can add Borders to a slicer by toggling the Border option from Off to On.

Power BI Slicer 13

Format Slicer Selection Control

The selection controls section helps you to format the Power BI slicer selection control. This section has two properties:

Power BI Slicer 14

Let me toggle the Show Select All option from Off to On. Now, you can see Select All under the Country Slicer

Power BI Slicer 15

By toggling Single Select option from On to Off, you can enable the slicer to select multiple fields.

Power BI Slicer 16

Let me select Australia, Germany, the United Kingdom, and the United States.

Power BI Slicer 17

Power BI Basic Filters

Power BI Filters are useful to restrict the data as per the requirements. For example, using Power BI basic filters, we can exclude a product from the display, or we can display top/bottom 10 performing records. Let me show you how to create Power BI basic filters with example.

  

How to use Power BI Basic Filters

To demonstrate the Basic Filters in Power BI, we are going to use the Clustered Column Chart that we created in our earlier post. As you can see from the screenshot Power BI below, we used the Country Name as the Axis field, Occupation as Legend field, and Sales amount as the Value field.

Power BI Basic Filters 1

Under the Filters section, you can see the list of filters that are available in Power BI

Power BI Basic Filters 2

Let me expand the English Country Region Name (in Short Country) to see the filter types.

Power BI Basic Filters 3

Use the drop-down list to see the list of Power BI filter types available for dimension.

  

In this example, we want to discuss the Power BI basic filters so, let me select the same.

Power BI Basic Filters 4

Selecting Basic Filters in Power BI display the rows that are available for this column. You can use the checkboxes to select One, None (or All)

Let me select Australia, Germany, the United Kingdom, and the United States. From the screenshot below, you can see that the clustered column chart is displaying the column that belongs to sleeted countries.

Power BI Basic Filters 5

Required Single Selection: It restricts us to select one field at a time. I mean, now you can select only one country name at a time.

Power BI Basic Filters 6

As you can see, we selected the United States.

Power BI Basic Filters 7

By unchecking the Required Single Selection property, you can select multiple fields.

Power BI Basic Filters 8

By clicking that little tiny clear filter button helps you remove the existing filters.

Power BI Basic Filters 9

Power BI basic Filters on Multiple dimensions

Let me expand the English Occupation column to apply filters on Occupation.

Power BI Basic Filters 10

Let me select the Management, Professional, and Skilled Manual fields as the basic filtering values. As you can see from the screenshot below, it is displaying 4 countries that we selected in Countries Filters and Three occupations that we selected now.

Power BI Basic Filters 11

This time, we are selecting a single field, i.e., Skilled Manual. 

 

Power BI Basic Filters 12

Delete Power BI Filters

Click on the tiny little Clear filter button to delete existing filters. For the demo purpose, let me delete the filter on the Occupation field.

Power BI Basic Filters 13

You can see that the Occupation field has no Filters

Power BI Basic Filters 14

Let me remove the filters on the Country

Power BI Basic Filters 15

Now you can see there are no filters in this Clustered Column Chart.

Power BI Basic Filters 16

Power BI Advanced Filters

How to create Power BI advanced filters with an example?. Power BI Advanced Filters use Wildcards to restrict the report data as per the requirements. For example, we can use these Power BI advanced filters to find products that start with S, or product contains Bikes, etc.

  

How to use Power BI Advanced Filters

To demonstrate the Advanced Filters in Power BI, we are going to use the Clustered Column Chart that we created in our earlier post. As you can see from the Power BI screenshot below, we used the Country Name as the Axis field, English Occupation as Legend field, and Sales amount as the Value field.

Power BI Advanced Filters 1

Under the Filters section, you can see the list of available filters in Power BI

Power BI Advanced Filters 2

Let me expand the English Country Region Name to see the filter types. By default, the Basic Filters option selected as the Filter type

Power BI Advanced Filters 3

Use the drop-down to change it to Advanced filtering

  Power BI Advanced Filters 4

The following are the list of options that are available for Power BI Advanced filtering

Power BI Advanced Filters 5

The following are the list of options available under the Show items when the value section:

  1. Contains: When this property is selected, it checks each record against the Match Value. And if it contains the match value at any position then, the record displayed.
  2. Does not Contains: It checks each record against the Match Value. And if it does not contains the match value at any position then, the record displayed.
  3. Starts With: If the record starts with the match value, then the record displayed.
  4. Does not start with: If the record does not start with the match value, then the record displayed.
  5. is: If the record matches exactly with the match value, then the record displayed.
  6. is not: If the record is not exactly equal to the match value, then the record displayed.
  7. is blank: This option displays all the records with the blank values.
  8. is not blank: It displays all the records that contain no blank values.
Power BI Advanced Filters 6

For the Power BI Advanced Filters demonstration purpose, we selected the Contains as the wildcard, and United as the keyword.

Power BI Advanced Filters 7

From the screenshot below, you can observe that the report is displaying the countries that contain the united keyword.

Power BI Advanced Filters 8

This time we used the does not contain as the wildcard, and Canada as the keyword. From the screenshot below, you can that the report is displaying all the countries except Canada.

Power BI Advanced Filters 9

Let me apply Power BI Advanced Filters on the English Occupation column.

We used the starts with as the wildcard, and M as the keyword. From the screenshot below, you can that the report is displaying the occupations that start with M (Management and Manual).

Power BI Advanced Filters 10

Let me use the OR operator and Starts with as the Keyword.

Power BI Advanced Filters 11

Here, we are using two wildcards: the first wildcard checks whether the Occupation contains a manual keyword or not. Or, the Second filter checks whether the occupation starts with P or not.

Power BI Advanced Filters 12

The below screenshot is showing the Occupation that contains a manual keyword, and the Occupation that starts with P. 

 

Power BI Advanced Filters 13

This time we are applying multiple filters on Country column. First, it checks whether the Country contains a united keyword or not. Or, the Second filter checks whether the country is not France.

Power BI Advanced Filters 14

The below report is showing the Countries that contains United keyword, and the country that is not France.

Power BI Advanced Filters 15

Use that tiny clear filter button to remove the Power BI Advanced Filters.

Power BI Advanced Filters 16

 

Power BI Top 10 Filters

Power BI Top N Filters are useful to display the top performing records, and Bottom N filters are helpful to display the least performing records. For example, we can display top or bottom 10 products by orders or sales. Let me show you how to create Power BI Top 10 Filters and Bottom filters with examples.

 

How to use Power BI Top 10 Filters

To demonstrate the Top N Filters in Power BI, we are going to use the Bar Chart that we created in our earlier post. As you can see from the screenshot Power BI below, we used the State Province Name as the Axis field, Sales amount as the Value field, and Order Quantity as Color saturation.

Power BI Top 10 Filters 1

Under the Filters section, you can see the list of filters that are available in Power BI

Power BI Top 10 Filters 2

Let me expand the State Province Name (in Short State) to see the filter types. By default, the Basic Filters option selected as the Filter type.

Power BI Top 10 Filters 3

Power BI Top 10 Filters

In order to enable Power BI top 10 filters, use the drop-down to change it to Top N filters

  Power BI Top 10 Filters 4

The following are the list of options that are available for Power BI TOP 10 filters

Power BI Top 10 Filters 5

Let me add Sales Amount to By Value section, and 10 to the text box

Power BI Top 10 Filters 6

The below Power BI report displaying the Top 10 states according to their Sales Amount. Or we can say, Top ten states based on their sales amount.

Power BI Top 10 Filters 7

Use the Dropdown arrow to minimize the filter

Power BI Top 10 Filters 8

Let me change the value to 5. It means, Power BI Top 5 filter

Power BI Top 10 Filters 9

As you can see that the Power BI filter has selected Top 5 State province names by sales amount

Power BI Top 10 Filters 10

Power BI Bottom 10 Filters

In order to apply Power BI bottom 10 filters, let me change the Show Items option from Top to Bottom, and leave the integer value to 5

Power BI Top 10 Filters 11

Click the Apply Filter button

Power BI Top 10 Filters 12

The following Power BI report is displaying the bottom 5 states as per their Sales Amount. Or we can say, Least performing states.

Power BI Top 10 Filters 13

Let me change the integer value to 10 

 

Power BI Top 10 Filters 14

The below report is displaying the Power BI bottom 10 states as per their Sales Amount.

Power BI Top 10 Filters 15

 

Power BI Page Level Filters

How to create Page Level Filters in Power BI with an example?. The Power BI Page level Filters are useful to filter the charts (or visuals) present on the page. For example, if your page contains four charts, then you can use this page level filter to filters those four reports at a time.

  

How to create Power BI Page Level Filters

To demonstrate the Page Level Filters in Power BI, we are going to use the Column ChartPie Chart, and Bar Charts that we created in our earlier Power BI post.

Power BI Page Level Filters 1

Under the Filters section, you can see the list of available page level filters in Power BI. You have to use the Page Level Filters section to create a filter at the page level.

Power BI Page Level Filters 2

Let me drag and drop the English Country Region Name from the fields section to the Page level Filters.

Power BI Page Level Filters 3

Expand the English Country Region Name to see the filter types. By default, the Basic Filters option selected as the Filter type.

  Power BI Page Level Filters 4

For the demo purpose, let me select Australia, Germany, the United Kingdom, and the United States. From the screenshot below, you can see that the Column chart is displaying Sales for the selected countries. The pie chart is displaying the selected countries. And, Bar chart is displaying the States that belong to these countries.

Power BI Page Level Filters 5

Use the drop-down to change the filtering type to Advanced filtering.

Here, we are applying multiple filters on the Country column. The first filter checks whether the Country contains a united keyword or not. Or, the Second condition checks the countries that do not start with F.

Power BI Page Level Filters 6

The below page is showing the Countries that contain the United keyword, and the countries do not start with F.

Power BI Page Level Filters 7

Let me remove the existing page level filters in Power BI, and drag and drop the Product Color from fields section to the Page level Filters.

Power BI Page Level Filters 8

Please select Blue, Red, Silver, and Yellow colors as the basic Filtering fields.

From the screenshot below, you can see that the Column chart is displaying the Sales Amount for the selected colors. The Pie chart is displaying the sales amount for the selected product colors, and Bar chart is displaying the sales amount for selected colors.

Power BI Page Level Filters 9

Let me remove the existing page level filters, and drag and drop the Sales Amount from Fields section to the Page level Filters. Next, expand the Sales Amount to see the filter options. Please refer to Filters on Measures article to understand these options.

Power BI Page Level Filters 10

For this Power BI Page Level Filters demonstration purpose, we selected is greater than as the operator, and 3000 the value. All the reports on the below page are displaying the countries or states whose Sales Amount is greater than 3000.

Power BI Page Level Filters 11

 

 

 

 

Power BI Report Level Filters


The Power BI Report level Filters are to filter the visuals (or charts) present in all the pages of a Report. For example, if your report contains 10 pages, then you can use this report level filter to filters those 10 pages at a time. Let me show you how to create a Report Level Filters in Power BI with example.

  

To create this Report (the combination of pages) for Power BI Report level Filters demo, we used the SQL Data Source that we created in our previous article.

Please refer to Connect Power BI to SQL Server article to understand the Data Source.

How to create Power BI Report Level Filters

To demonstrate the Report Level Filters in Power BI, we are going to use the Report 1 that we created in our earlier posts. This Power BI report has 19 pages: Column ChartPie ChartTreemapDonut ChartBar Chart, etc.

In this example, we create a Report Level Filter on the Stacked Bar Chart. Remember, this is the 8th page of a total of 19 pages.

  

As you can see from the screenshot below, we used the Color as the Axis field, Country Name as Legend field, and Sales amount as the Value field.

Power BI Report Level Filters 1

Under the Filters section, you can see the list of available report level filters in Power BI. You have to use the Report Level Filters section to create a filter at the report level.

Power BI Report Level Filters 2

Let me drag and drop the English Country Region Name from the fields section to the Report level Filters.

Power BI Report Level Filters 3

Expand the English Country Region Name to see the filter types. By default, the Basic Filters option selected as the Filter type.

Power BI Report Level Filters 4

For this Power BI Report Level Filter demonstration purpose, we selected Australia, Germany, the United Kingdom, and the United States.

From the screenshot below, you can see that the Stacked Bar chart is displaying the Sales for the selected countries in a legend.

Power BI Report Level Filters 5

Let me navigate to page 1 of 19. As you can see from the screenshot below, the Pie chart also filtered by the Report level filter. I mean, it is displaying the sales for the selected countries.

Power BI Report Level Filters 6

Let me navigate to page 18 of 19. You can see from the screenshot below, Power BI Report level filters are filtering these three charts.

Power BI Report Level Filters 7

Use the drop-down to change the report level filtering type to Advanced filtering.

Here, we are applying multiple filters on the Country column. The first filter checks whether the Country contains a united keyword or not. Or, the Second filter checks the countries that do not start with F. 

 

Power BI Report Level Filters 8

The below report is showing the Bars with Countries that contain the United keyword, and the countries did not start with F.

Power BI Report Level Filters 9

Let me navigate to page 1 of 19. As you can see, the Pie chart is displaying the sales for the countries that contain united or countries that does not start with F

Power BI Report Level Filters 10

Let me remove the existing Power BI report level filters. Next, drag and drop the Sales Amount from the fields section to the report level Filters. Then, expand the Sales Amount to see the filter options. Please refer Filters on Measures article to understand these options

Power BI Report Level Filters 11

For the demonstration purpose, we selected is greater than as the operator, and 1000 the value. From the screenshot below, you can see that the Stacked Bar chart is displaying the bars whose sales amount is greater than 1000.

Power BI Report Level Filters 12

Now, you can see that the same filter applied to the Column chart present on page 2 of 19

Power BI Report Level Filters 13

 

Drill through Filters in Power BI

Power BI Drill through Filters are useful to drill through a particular field, or we can say, apply filters on reports at multi-level. Let me show you how to create Drill through Filters in Power BI with an example.

 

How to create Drill through Filters in Power BI

To demonstrate the Power BI drill through filters report, we are going to use the Countries hierarchy. Please refer to Create Hierarchy article to understand the steps involved in creating a hierarchy.

As you can see from the below screenshot, we created a Column Chart, by adding the Country hierarchy in the Power BI Axis Fields. And added the Sales amount as the Value field, and Order Quantity as the Color Saturation.  

 

Drill through Filters in Power BI 1

Under the Filters section, you can see the list of available filters in Power BI. You have to use the Power BI Drill through Filters section to create a filter at multi-level.

Drill through Filters in Power BI 2

Let me drag and drop the Country from fields section to the Power BI Drill through Filters section.

  Drill through Filters in Power BI 3

Expand the Country to see the filter types.

Drill through Filters in Power BI 4

For the Power BI Drill through Filters demo purpose, let me select the United Kingdom. From the screenshot below, you can see that the Column chart is displaying Sales for the United Kingdom.

TIP: By default, you can only select One field (Country) at a time.

Drill through Filters in Power BI 5

Let me drill down to the next level. I suggest you refer Drill Up and Drill Down reports article to understand the Multi-level reports.

Now you can see the Sales by State (level 2). If you notice closely, it is displaying the sales for England because this is the only state available for the United Kingdom

Drill through Filters in Power BI 6

Let me go to another level. Now you can see the Sales by Cities present in the United Kingdom (level 3).

Drill through Filters in Power BI 6

You can drill down further to see the Sales by Postal Codes present in the United Kingdom

Drill through Filters in Power BI 8

This time we are selected in Australia and went all the way down to Postal Codes level. From the screenshot below, you can see the Sales by Postal Codes present in Australia.

Drill through Filters in Power BI 9

Let me remove the existing Power BI Drill through filter, and drag and drop the Sales Amount from fields section to the Drillthrough Filters. Next, expand the Sales Amount to see the filter options.

Drill through Filters in Power BI 10

Let me select the Sales Amount as 3399.99 

 

Drill through Filters in Power BI 11

Now you can see the States whose Sales Amount is at least 3399

Drill through Filters in Power BI 13

Now you can see the Postal Codes whose Sales Amount is at least 3399

Drill through Filters in Power BI 14

Let me Sort them by Sales Amount

Drill through Filters in Power BI 15