Sub topic 8
How a Filter Travels Through the Model
This chapter assumes you can create a relationship in the Model view, know that a one-to-many relationship has a "one" side and a "many" side, and can write a simple measure such as SUM ( Sales[SalesAmount] ). It explains how Power BI moves a filter from a slicer or visual across those relationships to reach the data that a measure calculates.
The core rule
A relationship carries a filter in one direction. With the default single cross-filter direction, the filter travels from the "one" side to the "many" side. In a star schema, that means from a dimension table (Product, Customer, Date) to the fact table (Sales).
The filter does not travel the other way. Filtering the Sales table does not narrow the dimension tables.
An example model
The model below has three dimensions that each relate to Sales. The arrows show the direction a filter can travel.
Following one filter step by step
Suppose a slicer is set to Product[Category] = "Bikes" and a card visual shows Total Sales = SUM ( Sales[SalesAmount] ). Power BI evaluates the card in these steps:
- The slicer adds a filter to the Product table. Only the product rows where Category is Bikes remain visible.
- Power BI follows the relationship from
Product[ProductKey]toSales[ProductKey]. It keeps only the Sales rows whose key matches one of the remaining products. - The measure sums
SalesAmountover those Sales rows.
The set of filters active when a measure is evaluated is called the filter context. Relationships extend that context from the table where you applied the filter to the tables connected to it.
Filters combine with AND
Several filters can reach the same table at once. For example, a Date slicer for 2025 and a Product slicer for Bikes both reach Sales. Power BI keeps only the Sales rows that satisfy both. Each added filter can only shrink the result, never grow it.
Chains of relationships
A filter can pass through more than one relationship. Suppose Product relates to Subcategory, and Subcategory relates to Category, which is a snowflake shape.
A filter on Category narrows Subcategory, which narrows Product, which narrows Sales. Every hop must point the right way. If one relationship in the chain has the wrong direction or is inactive, the filter stops at that point. Tables further along are not narrowed, so their totals look wrong.
The reverse direction does not work by default
A filter on the many side does not reach the one side. The following measures show the effect:
Product Count = COUNTROWS ( Product )
Sales Rows = COUNTROWS ( Sales )Put Customer[Country] on the rows of a table visual, with both measures beside it. Sales Rows changes for each country, because Customer filters Sales. Product Count shows the same number on every row, which is the total number of products. The filter goes from Customer to Sales and stops there. Sales relates to Product in the Sales-to-Product direction only, so nothing carries the filter on to Product.
Many first-time modelers read this repeated number as a bug. It is the model working as designed. To count the products each country bought, you have two options:
- Count from the fact table instead, for example
DISTINCTCOUNT ( Sales[ProductKey] ). Sales is already filtered, so this works with no model change. - Allow filtering in both directions on the Sales-to-Product relationship, or use
CROSSFILTERin one measure. Later chapters cover the risks of both-direction filtering.
Which table the field comes from
A visual's filter comes from the table that owns the field you place on it. The same measure gives different results depending on that choice.
| Field on the visual | Table it filters first | Effect on `Total Sales` |
|---|---|---|
| `Product[Category]` | Product | Filters Sales through Product, so each category shows its own total |
| `Customer[Country]` | Customer | Filters Sales through Customer, so each country shows its own total |
| `Sales[OrderNumber]` | Sales | Filters Sales directly, so each order shows its own total |
| A column in a table with no relationship | That table only | No effect, so every row repeats the grand total |
The last row is a common cause of "my slicer does nothing". If a table is not connected to Sales, its filter cannot reach Sales.
Filters that CALCULATE changes
Relationships define where filters can go. A measure can still change which filters are active. Functions such as CALCULATE can add a filter, replace one, or remove one. For example, CALCULATE ( [Total Sales], ALL ( Product ) ) clears every filter on Product before the sum runs, so the slicer on Category no longer affects that measure. The relationship is unchanged. Only the filter context is different.
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Slicer has no effect on a visual | No relationship, or an inactive one, between the slicer's table and the measure's table | Create or activate the relationship |
| Same value repeated on every row | Filter would need to travel from the many side to the one side | Measure from the fact table, or enable both-direction filtering where justified |
| A total is lower than expected after two slicers | The two filters combine with AND | Check each slicer's selection |
| A filter reaches some tables but not others | A relationship in the chain points the wrong way | Open the Model view and follow each arrow |
Exercise
A report has Customer, Product, and Sales tables. Each dimension has a single-direction, one-to-many relationship to Sales. A table visual shows Customer[Country] and the measure COUNTROWS ( Product ). Every country shows the same number. Why, and how can you get a per-country count of products bought without changing any relationship?
Show answer
The filter from Customer[Country] travels to Sales but cannot continue from Sales to Product, because the Sales-to-Product relationship only carries filters from Product to Sales. COUNTROWS ( Product ) therefore sees every product on every row. Use a measure on the already-filtered fact table instead, such as DISTINCTCOUNT ( Sales[ProductKey] ), which counts the distinct products in the Sales rows for each country.