Sub topic 8
How a Filter Travels Through the Model
This chapter assumes you can create relationships 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 a sum. Here you will follow a filter from a slicer or a visual through the relationships to a measure's result.
The core rule
A relationship passes a filter from one table to another in a set direction. In a one-to-many relationship with single cross-filter direction, the filter moves from the "one" side (usually a dimension table) to the "many" side (usually a fact table). It does not move the other way.
Suppose Product has one row per product, and Sales has many rows per product. If you pick the category "Bikes" in a slicer, Power BI filters Product to the bike rows. That filter then passes to Sales, which keeps only sales of those products. A measure such as SUM ( Sales[SalesAmount] ) is calculated over those remaining rows.
Following a chain
Filters keep moving as long as each relationship points the right way. Take this model:
Category(one) filtersProduct(many).Product(one) filtersSales(many).
Selecting a row in Category filters Product, and the filtered Product then filters Sales.
What does not travel
With single direction, filtering does not move from the "many" side to the "one" side. If you place a slicer on Sales[Region], the Product table is not narrowed by it. A visual that lists product names would still show every product.
You may also see a column from a dimension table repeat the same value on every row. This usually means the fact table cannot send a filter back to that dimension. The next chapters cover when both-direction filtering fixes this, and what it risks.
The same rule inside a measure
Measures follow the same path. CALCULATE changes the filters applied before the measure is evaluated, and those filters still travel through relationships.
Total Sales = SUM ( Sales[SalesAmount] )
Bike Sales =
CALCULATE (
[Total Sales],
Product[Category] = "Bikes"
)Bike Sales filters Product, and the filter passes to Sales through the relationship. You do not need to mention Sales in the filter. In a matrix with Product[Subcategory] on the rows, each row shows only sales that match both the row and the bike filter.
Common mistakes
| Symptom | Likely cause |
|---|---|
| A slicer has no effect on a visual | The slicer and the visual's fields sit in tables with no relationship path, or the path points the wrong way |
| The same total repeats on every row | The row field comes from a table that is not related to the table the measure sums |
| A dimension list is not narrowed by a fact-table slicer | The filter direction is single, so the filter cannot go from "many" to "one" |
To check a path, open the Model view and follow the arrows between the tables. An arrowhead shows the direction in which the filter flows.
Exercise
A model has Customer (one) related to Sales (many) with single cross-filter direction. You add a slicer on Sales[OrderYear] and a table visual that lists Customer[Name]. Does the slicer narrow the list of customers? Why or why not?
Show answer
No. With single direction, filters flow only from Customer (the "one" side) to Sales (the "many" side). The slicer filters Sales, but that filter does not return to Customer, so every customer is still listed.