<!-- https://learnsql.cpetoday.com/functions/dax/selectedvalue -->
# SELECTEDVALUE

Language: DAX
Category: Information
Syntax: SELECTEDVALUE(<columnName> [, <alternateResult>])
Summary: Returns the one selected value of a column, or an alternate result when zero or several values are selected.
Returns: The selected value (a scalar). The alternate result, or BLANK, when the selection is empty or has more than one value.
Level: Intermediate
Related: HASONEVALUE, SWITCH, FORMAT, ISFILTERED, VALUES, DIVIDE

## What it does
SELECTEDVALUE returns the value a user has picked, when exactly one value is selected in a column. If nothing is picked, or several are picked, it returns the alternate result you supply, or BLANK. It is the usual way to read a slicer choice in a measure, to change a title, pick a scenario or set a default. It replaces the older pattern of combining HASONEVALUE and VALUES.

## Syntax and arguments
- columnName: the column whose selection you want to read, such as `Scenario[Scenario]`.
- alternateResult (optional): the value to return when there is no single selection. If it is left out, the result is BLANK.

## Example
The management pack title should name the year that is selected. When no year is picked, or several are, the title reads "All years".

```dax
Report Title =
"Sales performance, "
    & SELECTEDVALUE('Date'[Year], "All years")
```

With the year 2026 selected, the title reads "Sales performance, 2026". With every year selected, it reads "Sales performance, All years". The title updates with the slicer and needs no extra measure.

## Example: a second, different use
A budget variance report that switches between Actual and Budget versus Forecast based on a scenario slicer, with a default of Actual:

```dax
Scenario Amount =
SWITCH(
    SELECTEDVALUE(Scenario[Scenario], "Actual"),
    "Actual", [Total Sales],
    "Forecast", [Forecast Sales],
    BLANK()
)
```

If the slicer is empty, the default "Actual" is used. The Scenario table is a small table with no relationship to the sales data, which is the usual design for a slicer.

## Things to watch
- A selection of several values returns the alternate result, which can surprise a user who picked two items. Show the rule in the title.
- Without an alternate result, an empty selection returns BLANK, so the title or measure goes blank.
- SELECTEDVALUE returns the value, not a list. Use CONCATENATEX for a list of selected items.
- The value is returned in the type of the column. A number column returns a number, so use FORMAT if you need text.
- Use a disconnected table for a scenario slicer. A slicer on the fact table filters the data rather than selecting a scenario.

## In business terms
SELECTEDVALUE lets finance reports respond to a choice: the year being reported, the scenario being compared, the entity being consolidated, the currency being displayed. It keeps one set of measures that reads the user's choice rather than many duplicated reports.
