Cross-Filter Direction
Power BI · Data Modeling
Theory
Cross-filter direction controls which way a filter travels along a relationship. With Single direction, the filter flows from the 'one' side to the 'many' side: selecting Segment = Corporate in Customers filters Sales to Ravi's and Karan's orders. Sales does not filter Customers back. With Both (bidirectional), filters also flow from the many side to the one side, so filtering Sales can reduce the rows of Customers too.
For example, a slicer on Products[Category] = Home with Single direction will not shrink a Customers slicer to just the customers who bought Home products. Bidirectional filtering would, but it can create ambiguous paths when several tables are connected, slow queries down and give confusing totals. A safer option is to keep Single and solve the specific need in a measure using CROSSFILTER, or to filter a slicer with a visual-level filter on a measure such as [Total Sales] is not blank.
Why we use it
Direction decides which visuals affect which. Understanding it explains why a slicer sometimes 'does nothing', and why turning everything to Both can make numbers wrong or slow.
When to use it
Keep Single direction on dimension-to-fact relationships as the default. Use Both sparingly, for example on a bridge table in a many-to-many design, or apply it in one measure with CROSSFILTER instead of on the whole model.
How it works
- A filter is applied on a table
- Filter moves along the relationship
- Is the filter moving from the one side to the many side? Yes: It always propagates. No: It propagates only if direction is Both.
- Measures evaluate on the filtered rows
- Visual shows filtered results
Syntax
Model view → double-click relationship → Cross filter direction: Single | Both
DAX (per measure):
CROSSFILTER(<columnName1>, <columnName2>, <direction>) // direction: None | OneWay | BothExample
// Count customers who bought Home products, keeping the model relationship Single
Customers Buying =
CALCULATE(
DISTINCTCOUNT(Customers[CustomerID]),
CROSSFILTER(Sales[CustomerID], Customers[CustomerID], Both)
)
// With a Category = Home filter: Asha and Karan bought Desk Lamps → 2Key points
- Single: filters flow from the one side to the many side
- Both: filters flow in both directions
- Bidirectional relationships can create ambiguity and slow queries
- CROSSFILTER changes direction inside one measure only
- Default to Single and change only with a clear reason