Forum Discussion
Jouni900
3 years agoFrequent Visitor
Dynamic measures with two slicers
Hi, I have a dashboard where there is a matrix visual and a stacked bar chart in a time series format. My measures are all related to volume and I have a slicer for the matrix where there are tw...
Sahir_Maharaj
Super User
3 years agoHello Jouni900,
1. Yes, you would need to duplicate the line for all measures that you have. For example, you could create separate measures for Actuals, To PY, Budget, and Forecast, each with its own IF statement based on the selected value of the "Volume" or "Sales" slicer.
2. To connect the "Volume" and "Sales" selection to the other slicer where you have a selection between "Monthly and YTD", you could create a measure that uses the SWITCH function to switch between the different measures based on the selected values of both slicers:
Selected Measure =
VAR VolumeSelected = SELECTEDVALUE('Slicer'[Selection])
VAR TimeSelected = SELECTEDVALUE('TimeSlicer'[Selection])
RETURN
SWITCH(TRUE(),
VolumeSelected = "Volume" && TimeSelected = "Monthly", [Monthly Volume Measure],
VolumeSelected = "Volume" && TimeSelected = "YTD", [YTD Volume Measure],
VolumeSelected = "Sales" && TimeSelected = "Monthly", [Monthly Sales Measure],
VolumeSelected = "Sales" && TimeSelected = "YTD", [YTD Sales Measure],
BLANK()
)
Let me know if you might need further assistance!