Returns the single value of a column when the filter context leaves only one distinct value; in any other case it gives an alternative result, which is BLANK unless you supply one.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains SELECTEDVALUE in context, with comparison tables and the common traps.
Terms in this definition
- Filter context
Whenever DAX evaluates an expression, each column is limited to certain values by slicers, report filters, a visual's rows and columns, relationships and any filters coded in formulas. Measures always calculate under these limits; row context, by contrast, means the current row.
- BLANK
DAX uses BLANK to mean no value at all. It resembles NULL in SQL but behaves more like an empty cell in Excel, so adding 20 to it returns 20; the BLANK function creates one and ISBLANK detects it.
Related terms
- HASONEVALUE
Tells you in DAX whether the current filters leave exactly one distinct value in a column, returning TRUE if they do. Writing IF ( HASONEVALUE ... ) can usually be shortened with SELECTEDVALUE.