Forum Discussion
KrisM
5 years agoRegular Visitor
Stacked column chart based on different slicers
I am trying to create a stacked column chart with values that change depending on selections from three different slicers. My data looks like this: I have three slicers to select the i...
- 5 years ago
KrisM , You have new table Summary and category has row values category 1, category2 etc
Then this should work as measure with Category from the summary on the axis
Sum by category = Switch( True() Max(Summary[Category]) = "Category 1", sum('Category 1'[Value], Max(Summary[Category]) = "Category 2", sum('Category 2'[Value]), Max(Summary[Category]) = "Category 3", sum('Category 3'[Value]) )
amitchandak
Super User
5 years agoKrisM , You have new table Summary and category has row values category 1, category2 etc
Then this should work as measure with Category from the summary on the axis
Sum by category = Switch( True()
Max(Summary[Category]) = "Category 1", sum('Category 1'[Value],
Max(Summary[Category]) = "Category 2", sum('Category 2'[Value]),
Max(Summary[Category]) = "Category 3", sum('Category 3'[Value])
)
KrisM
5 years agoRegular Visitor
Thanks, but this seems to return the sum of category 3 for all categories. I tried removing the max function and it gave the sum of each category without changing with the slicers. Is there something more that would need to go in the switch expression?