DAX Function Guide
IN Operator / CONTAINSROW function
Sam McKay
CEO & Founder
How does the IN Operator / CONTAINSROW function work?
IN Operator / CONTAINSROW function Formula Syntax
<scalarExpr> IN <tableExpr> ( <scalarExpr1>, <scalarExpr2>, … ) IN <tableExpr>
CONTAINSROW (<tableExpr>, <scalarExpr>[, <scalarExpr>, …])
How do you use the IN Operator / CONTAINSROW function?
The IN operator internally executes CONTAINSROW.
Related Blog Posts
Loading
Considerations when using the IN Operator / CONTAINSROW function?
The number of scalarExprN must match the number of columns in tableExpr.
Unlike the = operator, the IN operator and the CONTAINSROW function perform strict comparison. For example, the BLANK value does not match 0.
NOT IN is not an operator in DAX. To perform the logical negation of the IN operator, put NOT in front of the entire expression.
Related Video Tutorials
Loading
Formula examples using the IN Operator / CONTAINSROW function
EVALUATE FILTER(ALL(DimProduct[Color]), [Color] IN { "Red", "Yellow", "Blue" })
ORDER BY [Color]
EVALUATE FILTER(ALL(DimProduct[Color]), CONTAINSROW({ "Red", "Yellow", "Blue" }, [Color]))
ORDER BY [Color]
Related Courses
Loading