Sub topic 1
How filtering works in a report
Every number in a Power BI report is the answer to a question: sales for which product, which region, which year? Filtering supplies those qualifiers. This chapter explains the model behind it, so the later chapters on slicers, the Filter pane, and DAX build on a clear picture.
Prerequisites
This chapter assumes you have:
- Basic familiarity with Power BI Desktop or the Power BI service.
- A report with at least one page and a few visuals.
- A working understanding of tables, columns, and measures in a data model.
One dataset, many answers
A report page usually holds several visuals that read from the same data model. Each visual shows a different slice of that data. A card might show total sales, a bar chart might show sales by category, and a line chart might show sales by month.
The model holds the data once. What changes from visual to visual is the set of filters applied to it. A visual never shows "all the data" unless nothing restricts it. It shows the rows that survive every filter acting on it.
Where filters come from
Several things can restrict a visual at the same time:
- The visual's own fields. A bar chart with Category on its axis already splits the data into one bar per category. Each bar is filtered to a single category.
- Slicers. A slicer is a visual on the page that lets readers pick values, such as a year or a region.
- The Filter pane. It holds filters scoped to one visual, one page, or the whole report.
- Other visuals. Selecting a bar or a data point can cross-filter the other visuals on the page.
Power BI combines all of these. Filters from different sources are applied together, so a row must satisfy every one of them to be counted.
Filter context
Power BI calls the combined set of filters acting on a calculation its filter context. Each visual, and each cell in a table or matrix, has its own filter context.
Consider a measure defined in DAX, the formula language used in Power BI:
Total Sales = SUM ( Sales[SalesAmount] )The formula never mentions a category, a year, or a slicer. Yet the same measure shows different values in different visuals. Power BI recalculates it for each visual's filter context. In a bar chart split by category, the measure runs once per bar. In a card with a slicer set to 2025, it runs once, over 2025 rows only.
This is why you write the measure once and reuse it everywhere. The filters do the slicing.
Filters and relationships
Filters travel through the data model along relationships. Suppose a Product table connects to a Sales table. A filter on Product[Category] also restricts the related Sales rows. That is how a slicer built from the Product table changes a sum over Sales[SalesAmount].
If two tables have no relationship, a filter on one does not reach the other. The visuals then look as if the slicer is ignored. Keep this in mind. It is one of the first things to check when a filter seems to do nothing, and the troubleshooting chapter returns to it.
Authors and readers
Filters are applied by two groups of people:
- Report authors decide which slicers and filters exist, what scope they have, and what the defaults are.
- Report readers change selections within what the author provides.
Good report design depends on this split. Authors choose what to fix and what to expose.
What comes next
The next chapters take each filter source in turn. You will add slicers, learn the Filter pane and its three scopes, and choose between the two. Later chapters cover how visuals affect each other, and how DAX measures can respond to or ignore the current selection.
Exercise
A card visual uses the measure Total Sales = SUM ( Sales[SalesAmount] ). A page slicer is set to the year 2025. The card shows a smaller value than the same measure in a card on a page with no slicer. Why, and was the measure changed?
Show answer
The measure was not changed. Its filter context now includes the slicer's year selection, so the SUM covers only 2025 rows. The same formula gives a different result because the filters acting on it are different.
Exercise
You add a slicer on Region from a table that has no relationship to the Sales table. Selecting a region does not change a sales chart. What is the most likely cause?
Show answer
Filters pass between tables through relationships. Without a relationship, the Region selection never reaches the Sales rows, so the chart is unaffected.