HASONEFILTER is a DAX function that returns TRUE if there is exactly one filter applied to a specified table or column.
Syntax
HASONEFILTER( ColumnName )
Argument | Properties | Description |
---|---|---|
ColumnName | The column to check the filter info. |
HASONEFILTER is a DAX function that returns TRUE if there is exactly one filter applied to a specified table or column.
HASONEFILTER( ColumnName )
Argument | Properties | Description |
---|---|---|
ColumnName | The column to check the filter info. |
TRUE
when the number of directly filtered values on columnName
is one; otherwise returns FALSE
.
This function is similar to HASONEVALUE() with the difference that HASONEVALUE() works based on cross-filters while HASONEFILTER() works by a direct filter.
This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.
The following example shows how to use HASONEFILTER() to return the filter for ResellerSales_USD[ProductKey]) if there is one filter, or to return BLANK if there are no filters or more than one filter on ResellerSales_USD[ProductKey]).
= IF(HASONEFILTER(ResellerSales_USD[ProductKey]),FILTERS(ResellerSales_USD[ProductKey]),BLANK())
Other functions related to HASONEFILTER are:
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy