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.
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
Only(Region)
If(Count(DISTINCT Region) = 1, Only(Region), 'Several regions')
Only({<Year={2024}>} Target)Power BI equivalent
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
SELECTEDVALUElooks at the distinct values of a column in the current filter context. Qlik'sOnlytakes any expression. For an expression, useIF(COUNTROWS(VALUES(...)) = 1, ...)orMINX/MAXXwith a check.- If the column contains BLANK plus one value,
SELECTEDVALUEtreats that as two values and returns the alternate result. Qlik ignores nulls and returns the one value.
Official documentation
- Only - chart function (Qlik Help)
- SELECTEDVALUE function (DAX) (Microsoft Learn)
- HASONEVALUE function (DAX) (Microsoft Learn)
- SELECTEDVALUE (dax.guide)
Related pages
GetFieldSelections(Region)
GetFieldSelections and GetSelectedCount
GetFieldSelections returns the selected values of a field as text, often for dynamic titles. In DAX you combine ISFILTERED, VALUES and CONCATENATEX.
Partial / different approach
Concat(DISTINCT Product, ', ')
Concat (string aggregation)
Concat() joins values into one string. DAX has CONCATENATEX and Power Query has Text.Combine. The sort order and the duplicate handling are different from Qlik's defaults.
Direct equivalent
If(cond, then, else)
If and nested If
Qlik's If() maps directly to DAX IF and to Power Query's if ... then ... else. Long nested Ifs are cleaner as SWITCH(TRUE(), ...). Qlik's numeric booleans (-1/0) are the main difference.
Direct equivalent
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.