नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
Applies to:
Calculated column
Calculated table
Measure
Visual calculation
Returns true if values for all referred columns exist, or are contained, in those columns; otherwise, the function returns false.
Syntax
CONTAINS(<table>, <columnName>, <value>[, <columnName>, <value>]…)
Parameters
| Term | Definition |
|---|---|
table |
Any DAX expression that returns a table of data. |
columnName |
The name of an existing column, using standard DAX syntax. It cannot be an expression. |
value |
Any DAX expression that returns a single scalar value, that is to be sought in columnName. The expression is to be evaluated exactly once and before it is passed to the argument list. |
Return value
A value of TRUE if each specified value can be found in the corresponding columnName, or are contained, in those columns; otherwise, the function returns FALSE.
Remarks
The arguments
columnNameandvaluemust come in pairs; otherwise an error is returned.columnNamemust belong to the specifiedtable, or to a table that is related totable.If
columnNamerefers to a column in a related table then it must be fully qualified; otherwise, an error is returned.This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
Example
The following example creates a measure that tells you whether there were any Internet sales of product 214 and to customer 11185 at the same time.
= CONTAINS(InternetSales, [ProductKey], 214, [CustomerKey], 11185)