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

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.