Forum Discussion
Label for Multiple Dax Measures
- 5 years ago
You could use a disconnected table for that.
1) Make a table with two values Trailing twelve months and Year to date.
2) Make a slicer using this column
3) Build a dynamic measure that will change depending on the slicer selectionDynamic_Measure_Card1 = --Grab the value from the slicer VAR _SelectedValue = SELECTEDVALUE( 'DisconnectedTable'[Slicer], "Year to date") --Change the calculation based on that value RETURN SWITCH( _SelectedValue, "Year to date", [YTD_Measure], "Trailing twelve months", [TTM_Measure] )
The only problem with this approach is you'll have to create 4 dynamic measures (for the 4 cards)
A more elegant solution would include Calculation Group but this might be too much for what you are trying to accomplish.
You could use a disconnected table for that.
1) Make a table with two values Trailing twelve months and Year to date.
2) Make a slicer using this column
3) Build a dynamic measure that will change depending on the slicer selection
Dynamic_Measure_Card1 =
--Grab the value from the slicer
VAR _SelectedValue = SELECTEDVALUE( 'DisconnectedTable'[Slicer], "Year to date")
--Change the calculation based on that value
RETURN
SWITCH(
_SelectedValue,
"Year to date", [YTD_Measure],
"Trailing twelve months", [TTM_Measure]
)
The only problem with this approach is you'll have to create 4 dynamic measures (for the 4 cards)
A more elegant solution would include Calculation Group but this might be too much for what you are trying to accomplish.
M3trO1d... GM
We appear to be on the same page. Will give your suggestion a try.
Thank you for your quick response!
Regards,