Complete the code to return the selected product name or "Unknown" if none is selected.
ProductName = SELECTEDVALUE('Products'[Name], [1])
The SELECTEDVALUE function returns the selected value if there is only one, otherwise it returns the alternate result. Here, "Unknown" is used as the alternate.
Complete the code to check if exactly one year is selected in the 'Date' table.
IsSingleYearSelected = HASONEVALUE([1])HASONEVALUE checks if exactly one distinct value is selected in the specified column. Here, we want to check the Year column in the Date table.
Fix the error in the measure that returns the selected category or "Multiple" if more than one is selected.
SelectedCategory = IF(HASONEVALUE('Categories'[Category]), [1], "Multiple")
The SELECTEDVALUE function returns the single selected value or blank if multiple are selected. Inside the IF, it is the correct function to use to get the selected category.
Fill both blanks to create a measure that returns the selected region or "All Regions" if none or multiple are selected.
SelectedRegion = IF(HASONEVALUE([1]), SELECTEDVALUE([2]), "All Regions")
Both blanks require the same column reference from the Regions table's Region column to check and return the selected region.
Fill all three blanks to create a measure that returns the selected product or "Multiple Products" if more than one is selected, or "No Product" if none is selected.
ProductStatus = IF(HASONEVALUE([1]), SELECTEDVALUE([2]), IF(ISBLANK(SELECTEDVALUE([3])), "No Product", "Multiple Products"))
All blanks refer to the same column 'Products'[ProductName] to check selection and return appropriate messages.