DAX SELECTEDVALUE Function
Dynamically read single slicer selections in formulas and titles.
SELECTEDVALUE( Column, [AlternateResult] )Overview
SELECTEDVALUE returns the value of a column when there is only one distinct value in the current filter context; otherwise returns an alternate result.
SELECTEDVALUE is syntactic sugar for IF(HASONEVALUE(Column), VALUES(Column), AlternateResult). It is widely used in Power BI to create dynamic chart titles, subtitle KPIs, and drive disconnected parameter tables.
Selected Country Title =
"Performance in " & SELECTEDVALUE(Customers[Country], "All Countries")When to use SELECTEDVALUE
- Reading a single slicer selection into a measure, such as a chosen scenario or currency.
- Dynamic titles and labels that show what the user selected.
- Disconnected parameter tables that switch measure behaviour.
Worked examples
Dynamic title
Report Title =
"Sales for " & SELECTEDVALUE ( Region[Region], "all regions" )SELECTEDVALUE returns the region when exactly one is selected and the alternate text otherwise, so the title reads correctly for zero, one or many selections.
Switching measures from a parameter table
Selected Metric =
SWITCH (
SELECTEDVALUE ( Metric[Metric], "Sales" ),
"Sales", [Total Sales],
"Margin", [Total Margin],
"Units", [Total Units]
)A disconnected table of metric names drives a slicer; the measure reads the selection and returns the matching measure, with Sales as the default.
Common mistakes
- Expecting a value when multiple items are selected in a multi-select slicer (it will return the alternate result).
- Using SELECTEDVALUE on numeric measures rather than dimensional columns.
Performance notes
SELECTEDVALUE is inexpensive: it checks whether a column has exactly one visible value. Performance concerns come from what you do with the result — for example, a SWITCH that references many heavy measures is still fine, because only the matching branch is usually evaluated.
Frequently asked questions
- What does SELECTEDVALUE return when multiple values are selected?
- The alternate result you provide as the second argument, or BLANK if you do not provide one.
- SELECTEDVALUE vs VALUES?
- VALUES returns a table of the visible values and errors when used as a scalar with more than one value. SELECTEDVALUE is the safe scalar version: one value or the fallback.
- Why does SELECTEDVALUE return blank on the total row?
- On the total row, all values of the column are visible, so there is no single selected value. Provide an alternate result or handle the total with ISINSCOPE.