HASONEVALUE DAX Function (Information)
Returns true when there’s only one value in the specified column.
Syntax
Parameter | Attributes | Description |
---|---|---|
ColumnName |
The column to check the filter info. |
Return values
TRUE when the context for ColumnName has been filtered down to one distinct value only. Otherwise is FALSE.
Remarks
HASONEVALUE corresponds to the following code:
COUNTROWS ( VALUES ( <ColumnName> ) ) = 1
Related articles
Learn more about HASONEVALUE in the following articles:
-
Using the SELECTEDVALUE function in DAX
This article describes how the SELECTEDVALUE DAX function simplifies the syntax required in many scenarios where you need to read a single value selected in the filter context. » Read more
-
Distinguishing HASONEVALUE from ISINSCOPE
This article describes the differences between HASONEVALUE and ISINSCOPE, which are two useful DAX functions to control the filters and the grouping that are active in a report. » Read more
Related functions
Other related functions are:
Last update: Jan 11, 2021 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
MSDN documentation: https://docs.microsoft.com/en-us/dax/hasonevalue-function-dax