0
0
Power BIbi_tool~10 mins

SELECTEDVALUE and HASONEVALUE in Power BI - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table shows products and their sales amounts.

CellValue
A1Product
A2Apple
A3Banana
A4Cherry
B1Sales
B2100
B3150
B4200
Formula Trace
SelectedProduct = SELECTEDVALUE('Table'[Product], "Multiple")
Step 1: HASONEVALUE('Table'[Product])
Step 2: SELECTEDVALUE('Table'[Product], "Multiple")
Cell Reference Map
   A        B
1 Product  Sales
2 Apple    100
3 Banana   150
4 Cherry   200

Formula references 'Table'[Product] column cells A2, A3, A4.
The formula uses the Product column values from cells A2 to A4 to check selection.
Result
   A        B          C
1 Product  Sales    SelectedProduct
2 Apple    100      Multiple
3 Banana   150      Multiple
4 Cherry   200      Multiple
The SelectedProduct measure shows "Multiple" because more than one product is selected in the filter context.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does HASONEVALUE('Table'[Product]) return when multiple products are selected?
AFALSE
BThe first product name
CTRUE
DAn error
Key Result
SELECTEDVALUE returns the single selected value if only one exists; otherwise returns alternate result.