Forum Discussion
cmilligan262
6 years agoHelper II
Filtering columns in stacked column chart
I'm wanting my column chart below to always display the actual scenario and then use the filter to compare it to another scenario. Let me know I need to clarify further. Any help is appreciated. ...
cmilligan262
6 years agoHelper II
parry2k That worked perfectley. Thank you.
Can you explain to me what this is doing. I need to apply it to a couple more YTD formulas and want to make sure I'm understanding it.
parry2k
6 years agoSuper User
cmilligan262 see the full explanation in the measure
Measure =
VAR __rows =
DISTINCT ( --distinct will give us unique list of selected scenarios, it is required because if default scenario is selected in the slicer and we are also adding the default scenario in the UNION section, distinct will get us unique scenarios
UNION ( --union will add default scenario with all the selected scenarios in the slicer
CALCULATETABLE ( VALUES ( Slicer[Category] ), ALL ( Slicer[Category] ), Slicer[Default] = "Default" ), --get values for Actuals by looking at default column
VALUES ( Slicer[Category] ) --get list of all the selected sceanarios in the slicer
)
)
RETURN
CALCULATE (
SUM ( Data[Amount] ), --measure on which we want to apply the selected, it could be any existing measure
KEEPFILTERS ( --keefilters to keep the row contet of the scenario
TREATAS ( __rows, Data[Category] ) --treatus will be used to filter the scenarios
)
)
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!