Sub topic 1
How filtering works in a report
Prerequisites
Assume you know the basics of Power BI Desktop or the Power BI service. You should have a report with several visuals and understand tables, columns, and measures.
How filtering works in a report
A filter limits the rows available to a visual. Power BI combines filters from slicers, the Filter pane, and selections in other visuals. This combined set is the visual's filter context, which is the current set of filters used when Power BI calculates a result.
For example, this measure recalculates for every filter context:
Total Sales = SUM ( Sales[SalesAmount] )A date slicer can limit the measure to one month. A category filter can limit it further to one product category. The same measure can therefore show different values in different visuals.
Adding and using slicers
A slicer is a visual control that lets report readers filter a page directly. To add one, select the Slicer visual, then drag a field into its field well. Selecting a value filters visuals that use related data.
Use a slicer when the choice is important to the reader and should remain visible on the report page. For example, a Product[Category] slicer makes the current category easy to see and change.
Slicer types and the data they suit
Choose the slicer style based on the field:
- Use a list for a small number of categories.
- Use a dropdown for many categories when space is limited.
- Use a date or numeric range for continuous values such as order date or price.
- Use a hierarchy when readers need levels such as year, quarter, and month.
- Use a relative date slicer for choices such as the last 30 days.
Text columns usually suit lists or dropdowns. Numeric and date columns support range selection.
Selection behavior and slicer formatting
By default, a slicer may allow multiple selections. Turn on single-select when the report requires exactly one value. Enable “Select all” only when selecting every value is a useful, clear action.
Format the title, search box, orientation, and selection controls so the slicer matches its purpose. A slicer should also show enough values to make the current choice understandable.
> callout note > A slicer filters only visuals connected through the data model. An unrelated table will not respond until the model has an appropriate relationship.
Exercise
A category slicer changes a chart but not a card. What should you check first?
Show answer
Check whether the card uses related data and whether the slicer's interaction with the card is enabled.