Page 30 - DAX-Formula-Reference-Guide-Enterprise-DNA_Neat
P. 30
DAX Formulas Reference Guide | Related Functions
Return Value:
A table containing only the filtered rows.
=SUMX(FILTER(‘InternetSales_USD’,RELATED(‘SalesTerritory’[SalesTerritoryCountry])<>”U
nited States”)…,’InternetSales_USD’[SalesAmount_USD])
HASONEFILTER Function (DAX)
Returns TRUE when the number of directly filtered values on columnName is one;
otherwise returns FALSE.
Syntax: HASONEFILTER(<columnName>)
Parameter Definition
columnName The name of an existing column, using standard DAX syntax. It cannot be
an expression.
Return Value:
TRUE when the number of directly filtered values on columnName is one; otherwise
returns FALSE.
Remarks:
This function is similar to HASONEVALUE() with the difference that HASONEVALUE() works
based on cross-filters, while HASONEFILTER() works by a direct filter.
Example:
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())
HASONEVALUE Function (DAX)
Returns TRUE when the context for columnName has been filtered down to one distinct
value only. Otherwise is FALSE.
Syntax: HTML
HASONEVALUE(<columnName>)
Parameter Definition
columnName The name of an existing column, using standard DAX syntax. It cannot be
an expression.
Return Value:
TRUE when the context for columnName has been filtered down to one distinct value
only. Otherwise is FALSE.
+64 21 164 5508 | info@enterprisedna.co 30

