DAX Information - CONTAINS function



Description

Returns true if values for all referred columns exist, or are contained, in those columns. Otherwise, returns false.

Syntax

CONTAINS (<table>, <columnName>, <value>, [<columnName>, <value>] …) 

Parameters

Sr.No. Parameter & Description
1

table

Any DAX expression that returns a table of data.

2

columnName

The name of a column, in a table.

It cannot be an expression.

3

value

Any DAX expression that returns a single scalar value.

The expression is to be evaluated exactly once and before it is passed as a parameter.

Value is what you find, if it exists or if contained in columnName.

Return Value

TRUE or FALSE.

Remarks

  • The parameters columnName and value must come in pairs. Otherwise, the function returns an error.

  • columnName must belong to the specified table, or to a table that is related to table.

  • If columnName refers to a column in a related table, then it must be fully qualified. Otherwise, the function returns an error.

Example

= CONTAINS (Results, [Country],"IND", [Medal],"Gold") 

This DAX formula returns TRUE, if there exists a Gold Medal for the Country India in the Results table. Otherwise, returns FALSE.

dax_functions_information.htm
Advertisements