Overview - SELECTEDVALUE and HASONEVALUE
What is it?
SELECTEDVALUE and HASONEVALUE are two DAX functions used in Power BI to work with filters and selections in your data. SELECTEDVALUE returns the value when exactly one value is selected in a column, otherwise it returns a default or blank. HASONEVALUE checks if there is exactly one distinct value selected in a column and returns TRUE or FALSE. These functions help control what data your visuals or calculations show based on user choices.
Why it matters
Without these functions, it would be hard to create dynamic reports that respond correctly when users select one or many items. For example, showing details only when one product is selected or showing a message when multiple products are selected. They solve the problem of handling single versus multiple selections gracefully, improving report clarity and user experience.
Where it fits
Before learning these, you should understand basic DAX concepts like columns, filters, and measures. After mastering these, you can learn more advanced filter functions and dynamic calculations like SWITCH, IF, and CALCULATE with filter context.