Sub topic 1
How filtering works in a report
Every number in a Power BI report is the result of a question: "What is the total of this column, for these rows only?" The visual, the slicers, the Filter pane and the other visuals on the page each narrow the rows. This chapter describes how those narrowing steps combine. Later chapters cover each tool in detail.
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 basic understanding of tables, columns, and measures in a data model.
The examples use a small star-schema model. A Sales fact table holds one row per sale. A Product table holds category and product name. A Date table holds calendar attributes. Each dimension table has a one-to-many relationship to Sales, with a single filter direction from the dimension to the fact table.
The core idea: filter context
When a visual calculates a value, Power BI first works out which rows of the model are allowed to take part. The set of restrictions in force for that calculation is called the filter context. A measure is evaluated inside that context, and it only sees the rows that survive.
Consider this measure:
Total Sales = SUM ( Sales[SalesAmount] )The formula never mentions a category, a year, or a region. Yet one card might show the total for the whole company and another might show the total for Bikes in 2024. The formula is the same in both places. Only the filter context differs.
This is why authors say a measure is "recalculated for every combination of slicer and filter selections". Power BI does not store one answer per measure. It computes an answer for each visual, and for each cell, bar or point inside that visual, under that spot's own filter context.
Where filters come from
A visual's filter context is built from several sources at once. Knowing the sources is the first step in explaining any number you see.
| Source | Who controls it | What it restricts |
|---|---|---|
| The visual's own fields (axis, legend, rows, columns) | Author | One category, date or group per bar, row or cell |
| Slicers | Author builds them, reader uses them | Rows of the field the slicer is based on |
| Visual-level filters in the Filter pane | Author or reader | One visual only |
| Page-level filters in the Filter pane | Author or reader | Every visual on one page |
| Report-level filters in the Filter pane | Author or reader | Every visual on every page |
| Cross-filtering from another visual | Reader, by selecting a data point | Other visuals on the same page |
The first row surprises many learners. A column chart with Product[Category] on the axis is itself a filter. Each bar is evaluated with a filter for exactly one category. That is how one measure yields a different value for each bar.
Filters combine with AND
All the sources apply together. A row contributes to a number only if it passes every filter in the context. Filters do not take turns or override each other.
Suppose the Sales table totals 1,000,000 across everything, and the numbers below are illustrative:
- A card with no filters shows 1,000,000.
- A slicer set to
Category = Bikesmakes the card show 600,000. - A page-level filter
Year = 2024also applies, so the card shows 250,000. Those are the Bikes sales that happened in 2024. - The reader selects the "West" bar in a regional bar chart. Cross-filtering adds
Region = West, and the card now shows 90,000.
Each added filter can only keep the number the same or shrink it. Adding a filter to a field that already has one also intersects the two. If a slicer allows Bikes and Clothing, and a page filter allows Bikes and Accessories, the visuals see only Bikes.
How filters travel through relationships
A slicer on Product[Category] filters the Product table directly. A card showing SUM ( Sales[SalesAmount] ) reads from Sales, so something must carry the filter across. That something is the relationship.
In a typical star schema the relationship is one-to-many from the dimension to the fact table, with a single filter direction. The filter flows from the "one" side (Product) to the "many" side (Sales). Rows in Sales whose product belongs to a filtered-out category are removed from the calculation.
The reverse does not happen by default. Filtering Sales does not remove rows from Product. Two practical results follow:
- A slicer on a dimension column filters facts reliably.
- A slicer on a fact-table column does not narrow the other dimensions, unless the relationship's cross-filter direction is set to both. Changing that direction has performance and ambiguity costs, so treat it as a deliberate design choice.
If a field has no relationship path to the table your measure reads, it has no effect on that measure. Many "my slicer does nothing" problems come down to this. The troubleshooting chapter returns to it.
Slicers and the Filter pane as two interfaces to the same mechanism
Slicers and the Filter pane both add restrictions to the filter context. They differ in how they present that restriction, and who they are meant for.
A slicer is a visual placed on the canvas. Readers see it and click it. It always applies to the page it sits on, unless you sync it to other pages. By default it affects the other visuals on its page, and you can change this with Edit interactions.
The Filter pane is a side panel that lists the fields being filtered, grouped by scope: this visual, this page, all pages. It takes less canvas space and offers more filter types, such as Top N and relative date. Both tools are covered in their own chapters.
The two are not rivals. A report can use a slicer on Category and a report-level filter that excludes test data. The filter context contains both.
Cross-filtering and cross-highlighting between visuals
Selecting a data point in one visual, such as a bar or a pie slice, filters the other visuals on the page. Power BI offers two behaviors:
- Cross-filtering removes the data that does not match the selection. Other visuals redraw using only the selected rows.
- Cross-highlighting keeps all data on screen. It dims the portion that does not match, so the reader can compare the selection with the whole.
Which behavior you get depends on the visual type and the interaction settings. Column and bar charts typically cross-highlight other column and bar charts. Many other visuals cross-filter. Slicers always cross-filter.
Both behaviors add to the filter context, and both are temporary. They are cleared when the reader selects the same point again or clicks blank space. Slicers and Filter pane filters stay until someone changes them.
Reading a number: a worked method
When a value looks wrong, you can trace it. Take a card that shows 90,000 and ask these questions in order:
- Which fields appear in the visual itself? A card has none, so skip this for cards.
- Which slicers on this page have a selection? Check each one.
- Which cross-filter selections are active from other visuals?
- What does the Filter pane show for this visual, this page, and all pages?
- Does each filtered field have a relationship path to the table the measure reads?
If the filters are all active and valid, the number is correct, even if it is not what you expected. The goal is to find the full list of restrictions, because the answer is their intersection.
When a measure changes the context itself
Everything so far describes the context that arrives from the report. A measure can also change that context. DAX provides functions such as CALCULATE and REMOVEFILTERS that add, replace or drop filters before the calculation runs. For example, a measure can ignore the Product filters from slicers so that it always shows the company-wide total.
This chapter does not use those functions, because the later chapter on DAX and filters covers them. For now, remember that the filter context a report builds is the default. Measures can override it on purpose.
What to carry forward
- A value in a visual is a measure evaluated under a filter context.
- The filter context combines the visual's own fields, slicers, Filter pane filters, and cross-filter selections.
- Filters combine with AND, and a second filter on the same field intersects with the first.
- Filters move from the "one" side to the "many" side of a relationship by default.
- Slicers and the Filter pane use the same underlying mechanism but suit different readers and layouts.
Exercise
A page has a slicer set to Category = Bikes and a page-level filter Category = Clothing. A card on that page shows the sum of Sales[SalesAmount]. Both filters are on Product[Category], and the Product-to-Sales relationship is one-to-many with a single direction. What does the card show, and why?
Show answer
The card shows blank (no rows, so no total). Both filters apply together and combine with AND. A product's category cannot be both Bikes and Clothing, so no Sales rows pass both filters. Filters on the same field intersect, they do not override each other.
Exercise
A column chart has Product[Category] on its axis and Total Sales as its value. Nothing is selected in any slicer. Why does each bar show a different value even though every bar uses the same measure?
Show answer
The chart's axis field is itself a filter. Each bar is calculated in a filter context restricted to one category, so the same measure returns a different result for each bar.
Exercise
You add a slicer based on Sales[Region] where Region is a column in the fact table. A card based on a Product-table column count does not change when you use the slicer. Give the likely reason.
Show answer
Filters flow from the one side to the many side of a relationship. A filter on the Sales table does not travel back to the Product table unless the relationship cross-filter direction is set to both. So the Product-side calculation does not see the slicer.