DAX Function Guide

IN Operator / CONTAINSROW function
Empty image or helper icon

Sam McKay

CEO & Founder

How does the IN Operator / CONTAINSROW function work?
IN Operator / CONTAINSROW function (DAX) returns TRUE if a value row exists or is included in a table, otherwise FALSE returns. Except for syntax, the IN operator and CONTAINSROW function are functionally equivalent.
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