Sub topic 2
Adding and using slicers
This chapter assumes you can open a report in Power BI Desktop or the Power BI service, and that you know what tables, columns, and measures are in a data model. It also assumes the report has one page with a few visuals, such as a column chart and a table.
What a slicer does
A slicer is a visual that lets the reader choose which values of a field to keep. Every other visual on the same page recalculates using only the selected rows. The slicer holds no data of its own. It sends a filter to the other visuals, and each visual re-evaluates its fields and measures under that filter.
Add a slicer
- In Desktop, open the report and click an empty area of the canvas so that no visual is selected.
- In the Visualizations pane, select the Slicer icon.
- From the Data pane, drag a field into the slicer's Field well. For example, drag
Product[Category]. - Resize the slicer and place it where readers will look for it, usually at the top or left of the page.
You can also select a field in the Data pane first and then change the visual type to Slicer. Either way, the slicer's field type decides how it looks. A text field becomes a list. Dates and numbers get other styles, which the next chapter covers.
Choose the field carefully
The slicer filters other visuals through the relationships in your model. For that reason, use a column from a dimension table (such as Product, Customer, or Date) and not a column from the fact table.
- A column in a dimension table filters the related fact table through the relationship, so every visual that uses the fact table responds.
- A column in a table with no relationship to the visuals' tables filters nothing. The slicer looks normal, but the visuals don't change.
Select and clear values
With a vertical list slicer:
- Click a value to select it. The other values are dimmed in the list and the other visuals update.
- Hold Ctrl and click to select several values. Selected values combine with OR, so Bikes and Accessories shows rows that match either.
- Click the selected value again to deselect it.
- Click the eraser icon in the slicer header to clear all selections.
With nothing selected, the slicer applies no filter and visuals show everything. This is also what a reader sees when they first open the report.
Combine slicers
When a page has more than one slicer, their filters combine with AND. If one slicer selects Category = Bikes and another selects Year = 2025, visuals show only 2025 bike rows. Within a single slicer, multiple selections combine with OR.
A slicer's scope is the page it sits on. Visuals on other pages ignore it unless you synchronize it, which is a later chapter.
Show the current selection in a visual
Readers often need to see what is selected, especially after they leave a slicer collapsed. A measure can read the selection and return it as text. You can show it in a card or use it in a title.
Selected Category =
SELECTEDVALUE ( Product[Category], "All categories" )SELECTEDVALUE returns the category when exactly one is selected. When none or several are selected, it returns the second argument. Add the measure to a card next to the slicer to test it.
Common mistakes
| Symptom | Likely cause |
|---|---|
| Slicer changes nothing | The slicer field has no relationship to the visuals' tables |
| A visual ignores the slicer | The visual is on a different page, or its interactions were edited |
| Fewer rows than expected | Another slicer or a filter is also applied, and they combine with AND |
| Can't pick two values | Multi-select needs Ctrl, or the slicer is set to single select |
Exercise
A page has a Category slicer with Bikes selected and a Year slicer with 2025 selected. The reader also Ctrl+clicks Accessories in the Category slicer. Which rows do the visuals show?
Show answer
Rows from 2025 whose category is Bikes or Accessories. Selections inside one slicer combine with OR, and the two slicers combine with AND.
Exercise
You add a slicer on a column in the Sales fact table, but the column's values are unrelated to any dimension. The visuals don't change. What should you check first, and what is the usual fix?
Show answer
Check the model relationships for the slicer's table. Use the matching column from the related dimension table (for example Product[Category]) so the filter reaches the fact table.