HASONEVALUE Function (DAX)

How does the HASONEVALUE function (DAX) work?

Returns TRUE if only one distinct value has been filtered to the context for columnName. Otherwise, it is FALSE.

HASONEVALUE Formula Syntax

HASONEVALUE(<columnName>)

How do you use the HASONEVALUE function?

An equivalent expression for HASONEVALUE() is COUNTROWS(VALUES(<columnName>)) = 1.

Related Blog Posts

Related Support Forum Posts

Incorrect column totals in final results
Getting totals correct when using the budget allocation formula
Multiple dynamic filters

Considerations when using the HASONEVALUE function

HASONEVALUE() allows you to identify if your expression is being evaluated in the context of a single value for columnName.

Related Video Tutorials

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

Formula examples using the HASONEVALUE function

=IF(HASONEVALUE(DateTime[CalendarYear]),SUM(ResellerSales_USD[SalesAmount_USD])/CALCULATE(SUM(ResellerSales_USD[SalesAmount_USD]),DateTime[CalendarYear]=2007),BLANK())  

Related DAX Functions

HASONEFILTER

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.