CONTAINSROW DAX Function in Power BI

The CONTAINSROW function in DAX determines whether a table contains a row that exactly matches a specified set of values across all its columns. It returns:
• TRUE if at least one row in the table matches the provided values.
• FALSE if no such row exists.

DAX Syntax CONTAINSROW(table, value1, value2, ..., valueN)

The function has the following parameters:

For example, if a table has three columns, you must provide exactly three values—one for each column.

How It Works CONTAINSROW evaluates the table row-by-row to find an exact match where:
• The first column equals value1.
• The second column equals value2.
• And so on, up to the Nth column equalling valueN.
The function assumes that the order of the provided values aligns with the order of the columns as defined in the table. It does not allow you to specify column names explicitly; instead, the position of each value corresponds to the column’s position in the table’s structure.

Example: Let’s we have the following data in the table named ‘Student List’.

CONTAINSROW dax function in Power BI

The ID is of Whole number data type. The StudentRollno, StudentName, and AssociatedTeacher are of Text data type.

DAX

Containsrow Measure = CONTAINSROW('Student List', 4, "1203", "Katrina", "Anjana")

The output of the above dax function is shown below:

CONTAINSROW dax function in Power BI

Now, if we try:

DAX

Containsrow Measure = CONTAINSROW('Student List', 4, "1203", "Katrina", "Manoj")

The output of the above dax function is shown below:

CONTAINSROW dax function in Power BI

It returns FALSE, because no row matches this combination in the given table.