CONTAINSROW DAX Function (Information)

Returns TRUE if there exists at least one row where all columns have specified values.

Syntax

CONTAINSROW ( <Table>, <Value> [, <Value> [, … ] ] )
Parameter Attributes Description
Table
Iterator

The table to test.

Value
Row Context
Repeatable

A scalar expression to look for in the corresponding column.

Return values

Scalar A single boolean value.

A value of TRUE if a row of values exists in a table; otherwise, the function returns FALSE.

Remarks

The IN operator internally executes CONTAINSROW.

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. For example:

NOT [Color] IN { "Red", "Yellow", "Blue" }

The following expressions are equivalent:

Product[Color] IN { "Red", "Blue", "Yellow" }
CONTAINSROW ( { "Red", "Blue", "Yellow" }, Product[Color] )

The following expressions using two columns are equivalent:

( 'Date'[Year], 'Date'[MonthNumber] ) IN { ( 2018, 12 ), ( 2019, 1 ) }
CONTAINSROW ( { ( 2018, 12 ), ( 2019, 1 ) }, 'Date'[Year], 'Date'[MonthNumber] )

Last update: Dec 14, 2018   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

MSDN documentation: https://msdn.microsoft.com/en-us/query-bi/dax/in-operator-containsrow-function

DAX Conventions
Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Deprecated

This parameter is deprecated and its use is not recommended.

Contribute

Want to improve the content of CONTAINSROW? Did you find any issue? Please, report it us!
All submissions will be evaluated for possible updates of the content.