0
0
Power BIbi_tool~5 mins

SELECTEDVALUE and HASONEVALUE in Power BI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the DAX function SELECTEDVALUE do?

SELECTEDVALUE returns the single value when there is exactly one value selected in a column. If there are multiple or no values, it returns a default value you specify or blank.

Click to reveal answer
beginner
How does HASONEVALUE differ from SELECTEDVALUE?

HASONEVALUE returns TRUE if exactly one distinct value is selected in a column, otherwise FALSE. It is a logical check, while SELECTEDVALUE returns the actual value or default.

Click to reveal answer
beginner
Write a simple DAX expression using SELECTEDVALUE to get the selected product name or "No Product" if none or multiple are selected.
SelectedProduct = SELECTEDVALUE(Products[ProductName], "No Product")
Click to reveal answer
intermediate
Why would you use HASONEVALUE in a measure?

Use HASONEVALUE to check if a filter or slicer has exactly one value selected. This helps to write conditional logic, like showing detailed info only when one item is selected.

Click to reveal answer
beginner
What will SELECTEDVALUE(Column) return if multiple values are selected?

It returns blank (empty) unless you provide a default value as the second argument.

Click to reveal answer
What does SELECTEDVALUE(Column, "Default") return if no value is selected?
A"Default"
BBlank
CError
DFirst value in column
Which function returns TRUE or FALSE based on whether exactly one value is selected?
ASELECTEDVALUE
BHASONEVALUE
CVALUES
DFILTER
If you want to show a message when multiple products are selected, which function helps detect this?
ACALCULATE
BSELECTEDVALUE
CSUM
DHASONEVALUE
What will SELECTEDVALUE(Product[Name]) return if exactly one product is selected?
AThe selected product name
BBlank
CError
DAll product names
Which of these is a correct use of HASONEVALUE in a measure?
ASUM(Category[Sales])
BSELECTEDVALUE(Category[Name])
CIF(HASONEVALUE(Category[Name]), "One", "Many")
DFILTER(Category, HASONEVALUE(Category[Name]))
Explain in your own words how SELECTEDVALUE and HASONEVALUE work and when you would use each.
Think about selecting one item vs checking if only one item is selected.
You got /4 concepts.
    Describe a simple scenario in a report where using HASONEVALUE improves user experience.
    Imagine a product detail page that only shows details if one product is chosen.
    You got /3 concepts.