Forum Discussion
Dynamic measures with two slicers
Hello Jouni900,
To do this, you will need to create two new measures, one for "Volume" and one for "Sales". These measures will use the same underlying data as your existing measures, but will be calculated differently depending on the selection in the new slicer.
Volume = IF(SELECTEDVALUE('Slicer'[Selection]) = "Volume", [Existing Volume Measure], BLANK())
Sales = IF(SELECTEDVALUE('Slicer'[Selection]) = "Sales", [Existing Sales Measure], BLANK())
Once you have created these measures, you can use them in your visuals instead of the existing volume and sales measures. You can also use the new slicer to control which measure is displayed in each visual.
For the time series chart, you can use the same approach to create measures for each benchmark (e.g. "Previous Year Sales", "Budget Sales", "Forecast Sales"). You can then use a switch statement in your visual to select the appropriate measure based on the selection in the benchmark slicer.
This will give you more flexibility in how you display your data, and will make it easier to switch between different measures and benchmarks.
Let me know if this works for you.
Hi, Sahir_Maharaj
Thanks for the reply, I was able to progress a bit with it. I have couple follow up questions about the matrix visual
1) I have measures such as Actuals, to PY etc in the matrix. Should I duplicate the line for all measures that I have?
Volume = IF(SELECTEDVALUE('Slicer'[Selection]) = "Volume", [Existing Volume Measure], BLANK())for Actuals, to PY etc.?
2) How do I connect the "Volume" and "Sales" selection to the other slicer where I have a selection between "Monthly and YTD". I would like that all the measures that I have change to YTD when changed so, so I would not need to include "YTD" measures separately to the matrix.
My current solution for the Act is a following. What I am missing at this point is how to tie it to the "Volume" and "Sales" selection