Only(Region)

Only in Power BI

Only() returns a value when exactly one value is possible and null otherwise. In DAX that is SELECTEDVALUE, which also accepts an alternate result.

Direct equivalent DAX

Short answer: Only(Region) becomes SELECTEDVALUE(Customer[Region]). Use the second argument for a fallback, and HASONEVALUE for the test on its own.

What it does in Qlik

Only(expr) returns the single possible value of the expression across the records in scope, and NULL if there are zero or several. It is common in titles, in conditional expressions and in script Group By loads.

Qlik example

Qlik chart expressions
Only(Region)
If(Count(DISTINCT Region) = 1, Only(Region), 'Several regions')
Only({<Year={2024}>} Target)

Power BI equivalent

DAX

DAX
Region label = SELECTEDVALUE ( Customer[Region], "Several regions" )

Target 2024 =
CALCULATE ( SELECTEDVALUE ( Targets[Target] ), 'Date'[Year] = 2024 )

Is single region = HASONEVALUE ( Customer[Region] )

For a script Group By with Only(...), see Group By loads.

Gotchas and behaviour differences

  • SELECTEDVALUE looks at the distinct values of a column in the current filter context. Qlik's Only takes any expression. For an expression, use IF(COUNTROWS(VALUES(...)) = 1, ...) or MINX/MAXX with a check.
  • If the column contains BLANK plus one value, SELECTEDVALUE treats that as two values and returns the alternate result. Qlik ignores nulls and returns the one value.

Official documentation

Related pages

Spotted an error or a better pattern? QlikToDax is maintained by a working BI consultant; corrections are welcome via the About page. Last reviewed 2026-10-25.