Introduction to Slicers in Power BI

In this article, we will look at what a Power BI slicer is and some of its use cases with the help of examples. 

We will also look at where slicers work well and their limitations. 

We cover using slicers during our beginners Power BI courses if you would like to learn more.

 

What Is A Slicer?

A Power BI slicer provides an interactive way to filter and compare information on different visualisations in Power BI. 

Power BI slicers can be categorised into three broad types: 

  • Categorical Slicers:
    • Filter information via categorical data such as country names, city names, product categories etc. 
  • Numeric Slicers:
    • Filter information based on a range of numeric values. For instance, age, total sales, scores in an exam, etc.
  • Date Slicers 
    • Date slicers are a type of numeric slicer. However, they deal specifically with date type data and filter information between a range of dates.

You can also use Power BI slicers to filter hierarchical data. 

For example, you can create a slicer that filters information based on country names and cities within that country. 

This article will look at categorical and numeric slicers, the two most basic types of slicers in Power BI. 

See the following articles for detailed articles on using data slicers and hierarchy slicers. 

Slicers are available to all Power BI users, whatever Power BI licence they have.

Let’s now see the Power BI slicer in action.

 

Importing A Trial Dataset 

The CSV file for the dataset used to create slicers in this article is available at this link.

https://raw.githubusercontent.com/curran/data/gh-pages/superstoreSales/superstoreSales.csv 

You can either download the CSV file and then go to the Power BI Dashboard and import the CSV file. Or, you can directly import the dataset from the online resource.

To import the data from this online link, click on the “Get data” button from the ribbon menu on the dashboard, type “Web” into the search bar and then select “Web” from the list of options. 

 

 

Enter the Github link containing your CSV file in the following dialogue box.

 

 

You will see the window below.

Click the “Load” button to load the data in the reports view into Power BI.

 

Creating A Simple Slicer

A slicer in Power BI filters information appearing on a visualisation inside the Power BI reports view

Therefore, before you can add a slicer, it is best first to add a visualisation that you will be filtering with a slicer.

 

Note: It is not necessary to add a visualisation before adding a slicer on your reports View. 

 

Let’s add a pie chart that displays the distribution of the sum of sales for different product sub-categories in our dataset.

Click the Pie chart icon from the Visualizations pane. 

Add the Product Sub-Category column from the dataset to the Legend field and Sales column to the Values field, as shown below:

 

 

You will see the following pie chart in the view of your report

 

 

As discussed earlier, in Power BI, you can add slicers for categorical as well as numerical columns.

Let’s start by creating a categorical slicer.

 

Creating Slicers For Categorical Fields

Let’s create a slicer that allows you to filter your pie chart using the product sub-category. 

To do so, click the Slicer icon from the Visualizations pane. 

Next, add the Product Sub-category column from the dataset in the Field option.

 

 

You will see the following slicer in the view of your report

By default, all the sub-categories are unchecked.

 

 

Let’s check the first four sub-categories.

 

 

If you now look at your pie chart, you can see that it only contains the distribution of sales for categories selected by your slicer. 

 

 

Switching between List and Drop Down View

You can switch between the list and dropdown view for slicers that contain categorical fields. 

By default, the categories are displayed in the form of a list. 

You can change the view to dropdown by selecting the downward arrow symbol in the top right corner of your slicer. 

You will see the categories in the form of a dropdown with a scrollbar, as shown below:

 

Creating a Slicer for Numeric Fields

You can also create slicers for numeric fields such as sales, profit etc.

 Let’s create a slicer for the Sales column.

 

 

You will see a slicer with a range bar.

 

 

You can drag the range circles from left to right, and vice versa, to select a specific sales range. 

 

You can also enter the range values you want in the text fields in the top left.

In the above example, the slicer minimum is set to approximately 26,000, and the maximum is set to 89,000.

This slicer is based on the sales value in the individual order. 

The pie chart now shows the sales distribution for those selected sub-categories where at least one order has a total sales value of between 25,956 and 89,061. 

 

Adding Multiple Slicers

You can also filter information on your visualisations using multiple slicers. 

For example, in the screenshot below, there are two slicers. 

The numeric slicer selects sub-categories in the pie chart based on the orders with a sales value between 25,683.47 and 89061.05. 

This selector selects four sub-categories. These categories are then shown in the product sub-category slicer below it, as they are the only sub-categories that meet the requirements of the numerical slicer.

The categorical selector has then been used to select 3 out of the four categories. 

 

 

In the output pie chart, such as the one seen below, you can see the sales distribution for three categories selected via the numeric and categorical slicer. 

 

Formatting A Slicer

There are several ways to format and add styles to your slicers. 

Click the roll brush icon next to the slicer properties to see all the formatting options, as shown in the following screenshot. 

 

 

You can see formatting options grouped into various categories in the screenshot above. Let’s see some of them.

 

Enabling Single Selection 

By default, you can select multiple options on your slicer. 

You select multiple checkboxes using “click + control” to do so.

If you want to enforce single selection on your slicers, go to Selection controls and enable the Single select option as On.  

You will see that the slicer will contain radio buttons instead of checkboxes. You will only be able to select a single radio button at a time. 

 

Styling The Slicer Header

Let’s add some styles to the slicer header. 

To do so, select the Slicer header option and change the colour and fonts as shown in the screenshot below:

Your slicer should now look like this.

Note: Single selection is only available for categorical slicers.

 

Styling Items In A Slicer

You can also style individual items in a slicer.  

For example, select the Items option and change the font colour, text size, bold font, and other options, as shown in the following screenshot.

You can see that a new style has been applied to the items in your slicer. 

 

Changing The Slicer Background 

As a last formatting example, let’s change the background colour of your slicer. 

To do so, click the Background options from the formatting options and change the background colour and transparency options as follows:

Your slicer now looks like the one in the following image. 

These are some of the formatting options available. I would suggest you play around with different formatting options and see how they affect the look and feel of your slicer. 

 

When Should You Use a Slicer

Power BI slicers are visual-level elements displayed on a report canvas. 

Following are some situations where a Power BI slicer can come in handy:

  1. When you want end users to filter information in a published report.
  2. When two or more visualisations have active connections, and you want to filter information on all connected visualisations simultaneously.
  3. When you want to show less frequently viewed or unnecessary columns on the reports, just in case users might want to access them.
  4. To easily view all the currently applied filters on different reports rather than opening and checking static filter dropdown lists. 

 

Limitations of Slicers

The Power BI slicer has some limitations as well:

  1. A slicer can’t be pinned to a dashboard in Power BI.
  2. The numeric slicer is only available on the Power BI desktop and not in Power BI Service.
  3. The numeric slicer filters data on row-level and does not deal with aggregated values.
  4. Slicers do not work with measures.

 

Conclusion

Slicers are incredibly useful. 

Mastering them will make your reports and dashboards more interactive and practical for users. 

They’ll also save you a lot of questions from users asking you to manipulate the data – once you start using them, you’ll never go back.

 

Articles On Power BI Visuals

Bullet Charts In Power BI

Scatter Charts In Power BI

Working With Maps In Power BI

Using Word Clouds In Power BI

Gantt Charts In Power BI

The Decomposition Tree Visual In Power BI

The Smart Narrative Visual In Power BI

About Ben Richardson

Ben is a director of Acuity Training which he has been running for over 10 years.


He is a Natural Sciences graduate from the University of Cambridge and a qualified accountant with the ICAEW.


He previously worked as a venture capitalist and banker and so had extensive experience with Excel from building financial models before moving to learn SQL, Microsoft Power BI and other technologies more recently.