Short answer: SELECTEDVALUE ( column, alternate ) returns the column's value when the current filter context has exactly one distinct value, and the alternate result (BLANK by default) when it has none or several. HASONEVALUE ( column ) returns TRUE in the same case. Use them for dynamic titles ("Revenue for Bikes"), reading a what-if slicer, switching measures, and hiding numbers at total level. Microsoft lists SELECTEDVALUE ( col, alt ) as equivalent to IF ( HASONEVALUE ( col ), VALUES ( col ), alt ).
A report title that says "Revenue" whatever is selected makes readers check the slicers. A title that says "Revenue for Bikes, 2026" answers that before they ask.
What do they return?
| Context | HASONEVALUE | SELECTEDVALUE |
|---|---|---|
| Slicer on Bikes | TRUE | Bikes |
| Slicer on Bikes and Clothing | FALSE | All categories |
| No selection (all four) | FALSE | All categories |
| Row "Bikes" in a table | TRUE | Bikes |
| Total row | FALSE | All categories |
What are everyday uses?
-- dynamic title
Title =
"Revenue for " & SELECTEDVALUE ( 'Product'[Category], "all categories" )
& ", " & SELECTEDVALUE ( 'Date'[Year], "all years" )
-- what-if parameter: a disconnected table of discounts 0% to 30%
Discount Selected = SELECTEDVALUE ( Discount[Discount], 0 )
Revenue after Discount = [Revenue] * ( 1 - [Discount Selected] )
-- switch measures from a slicer on a small table of names
Selected Metric =
SWITCH (
SELECTEDVALUE ( Metric[Name], "Revenue" ),
"Revenue", [Revenue],
"Margin", [Margin],
"Orders", [Orders]
)
-- hide a value at total level
Price per Unit =
IF ( HASONEVALUE ( 'Product'[Product] ), DIVIDE ( [Revenue], [Units] ) )For the measure switch, field parameters are often the better tool today, as they also switch formats and work on axes.
What if several values are selected?
List them with CONCATENATEX:
Selected Categories =
VAR N = COUNTROWS ( VALUES ( 'Product'[Category] ) )
RETURN
IF (
N <= 3,
CONCATENATEX ( VALUES ( 'Product'[Category] ), 'Product'[Category], ", ", 'Product'[Category] ),
N & " categories"
)It reads "Bikes, Clothing" or "4 categories".
How do ISFILTERED and ISCROSSFILTERED differ?
| Function | TRUE when |
|---|---|
HASONEVALUE ( col ) | exactly one value of col is visible, by any route |
ISFILTERED ( col ) | col itself has a direct filter (a slicer on it, a row of the visual) |
ISCROSSFILTERED ( col ) | col is filtered directly or through another column or table |
ISINSCOPE ( col ) | col is the level being grouped in the visual (see ISINSCOPE) |
A product filtered to one category through a Product slicer makes HASONEVALUE ( 'Product'[Category] ) TRUE but ISFILTERED ( 'Product'[Category] ) FALSE.
What goes wrong?
VALUESinstead ofSELECTEDVALUE.VALUES ( col )returns a table; used as a scalar with several values it errors ("A table of multiple values was supplied"). Microsoft's guidance: useSELECTEDVALUE.- No alternate result. BLANK in a title reads "Revenue for "; give an alternate.
- Totals disappear.
IF ( HASONEVALUE ( ... ) )blanks totals on purpose; make sure that is wanted. - What-if default. Without an alternate, a cleared what-if slicer returns BLANK and the formula breaks; give a default.
Where can you check this?
- Microsoft Learn: SELECTEDVALUE function (DAX)
- Microsoft Learn: HASONEVALUE function (DAX)
- Microsoft Learn: Use SELECTEDVALUE instead of VALUES
Where do you start?
Add a dynamic title measure to your main page and bind it to the visual title with fx. ISINSCOPE handles different logic at total and detail level.