DAX Function Guide

CROSSFILTER
Empty image or helper icon

Sam McKay

CEO & Founder

How does the CROSSFILTER work?
The CROSSFILTER function (DAX) defines the cross-filtering direction that can be used in a calculation between two columns.
CROSSFILTER Formula Syntax

CROSSFILTER(
     <columnName1>, <columnName2>, <direction>
)

How do you use the CROSSFILTER?

Use CROSSFILTER to change the join type for relationships. With this function, you can change how the cross-filter direction behaves between two columns defined by a relationship. It can be used in functions that have a filter for an argument.

Related Blog Posts

Loading

Considerations when using the CROSSFILTER?

In CROSSFILTER, the cross-filtering setting of a relationship is not important. This function will override any cross-filtering setting.

An error occurs if any of the columns named as an argument is not part of a relationship, or if the arguments belong to different relationships.

If expressions with the CALCULATE function are nested and more than one expression uses CROSSFILTER, then the innermost CROSSFILTER is the one that prevails.

Related Video Tutorials

Loading

Formula examples using the CROSSFILTER

= CALCULATE([Distinct Count of ProductKey], CROSSFILTER(FactInternetSales[ProductKey], DimProduct[ProductKey] , Both))** “`

= CALCULATE (Sales[Distinct Count of Products], CROSSFILTER (Sales[Product],Products[Product],Both))

= crossfilter([{a: 1, b: 2}, {b: 1, c: 3}, {a: 0, b: 2, c: 4}]);

Related Courses

Loading