Cheat Sheets/Power BI/HASONEVALUE
DAX function

HASONEVALUE — DAX function reference

True if exactly one value.

Syntax

dax
HASONEVALUE(<column>)

Examples

dax
HASONEVALUE(Sales[Region])
→ true / false
dax
IF(HASONEVALUE(Sales[Region]), "Region: " & VALUES(Sales[Region]), "All regions")
→ Manual equivalent of SELECTEDVALUE
dax
IF(HASONEVALUE(Product[Category]) && HASONEVALUE(Product[SubCategory]), [Total Sales], BLANK())
→ Only shows a value at the most granular level of a hierarchy

Common mistakes & gotchas

Related DAX functions

From Filter context

← Back to the Power BI (DAX) cheat sheet