HASONEFILTER Function (DAX)

How does the HASONEFILTER function (DAX) work?

HASONEFILTER function (DAX) returns TRUE when the number of directly filtered values on columnName is one; otherwise returns FALSE.

HASONEFILTER Formula Syntax

HASONEFILTER(<columnName>)

How do you use the HASONEFILTER function?

It returns TRUE when the number of directly filtered values on columnName is one and only one. Otherwise, returns FALSE.

Related Blog Posts

Related Support Forum Posts

Measure not give the same result inside SWITCH
Previous Value identification
Standard deviation and median while filtering measures using slicers

Considerations when using the HASONEFILTER function

This function is similar to HASONEVALUE() with the difference that HASONEVALUE() works based on cross-filters while HASONEFILTER() works by a direct filter.

Related Video Tutorials

EDNA TV-Unique subtotal
EDNA TV-Harvesting a slicer selection

Formula examples using the HASONEFILTER function

=IF(HASONEFILTER(ResellerSales_USD[ProductKey]),FILTERS(ResellerSales_USD[ProductKey]),BLANK())  

Related DAX Functions

HASONEVALUE

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI
Center of Excellence

DOWNLOAD


Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.


Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide
Membership