DAX function
CROSSFILTER — DAX function reference
Set cross-filter direction.
Syntax
dax
CALCULATE(<expression>, CROSSFILTER(<columnName1>, <columnName2>, <direction>))
Examples
dax
CALCULATE([Sales], CROSSFILTER(Sales[CustID], Customer[CustID], BOTH))
→ A number
dax
CALCULATE(DISTINCTCOUNT(Customer[CustomerID]), CROSSFILTER(Sales[CustID], Customer[CustID], BOTH))
→ Distinct customers filtered by a Product-side selection, via bidirectional filtering just for this measure
dax
CALCULATE(SUM(Sales[Amount]), CROSSFILTER(Sales[CustID], Customer[CustID], NONE))
→ Disables the relationship entirely for this calculation
Common mistakes & gotchas
- Direction NONE temporarily removes filtering across that relationship altogether (not just direction) — the way to compute "as if the tables were unrelated" without physically deleting the relationship.
- Turning a normally single-direction relationship BOTH inside CROSSFILTER can introduce ambiguous filter paths in models with multiple relationships between the same tables, causing a circular-dependency-style error at evaluation time.
Related DAX functions
From Relationships