DRAG DROP (Drag and Drop is not supported)
You have a Power BI dataset that contains the following measures:
-Budget
-Actuals
-Forecast
You create a report that contains 10 visuals.
You need provide users with the ability to use a slicer to switch between the measures in two visuals only.
You create a dedicated measure named CG Measure Switch.
How should you complete the DAX expression for the Actuals measure? To answer, drag the appropriate values to the targets. Each value may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:
- See Explanation section for answer.
Answer(s): A
Explanation:
Box 1: SELECTEDMEASURENAME()
SELECTEDMEASURENAME is used by expressions for calculation items to determine the measure that is in context by name.
Syntax: SELECTEDMEASURENAME()
No parameters.
Example:
The following calculation item expression checks if the current measure is Expense Ratio and conditionally applies calculation logic. Since the check is based on a string comparison, it is not subject to formula fixup and will not benefit from object renaming being automatically reflected. For a similar comparison that would benefit from formula fixup, please see the ISSLECTEDMEASURE function instead.
IF (
SELECTEDMEASURENAME = "Expense Ratio",
SELECTEDMEASURE (),
DIVIDE ( SELECTEDMEASURE (), COUNTROWS ( DimDate ) )
)
Incorrect:
* SELECTEDMEASURE is used by expressions for calculation items to reference the measure that is in context.
Syntax: SELECTEDMEASURE()
Can only be referenced in the expression for a calculation item.
* ISSELECTEDMEASURE is used by expressions for calculation items to determine the measure that is in context is one of those specified in a list of measures.
Syntax: ISSELECTEDMEASURE( M1, M2, ... )
Power BI dataset DAX slicer ISSELECTEDMEASURE
Box 2: SELECTEDVALUE()
SELECTEDVALUE returns the value when the context for columnName has been filtered down to one distinct value only. Otherwise returns alternateResult.
Syntax:
SELECTEDVALUE(<columnName>[, <alternateResult>])
M1, M2, ... - A list of measures.
Reference:
https://docs.microsoft.com/en-us/dax/selectedmeasurename-function-dax
https://docs.microsoft.com/en-us/dax/selectedvalue-function
Reveal Solution Next Question