Forum Discussion

lg1551's avatar
lg1551
Icon for Resolver II rankResolver II
3 years ago
Solved

Dynamic Y-Axis on Stacked Bar Chart?

It looks as if my post is gone from 2 days ago. I don't see it in my history either.

 

I have a stacked bar chart that I want to dynamically change the Y-Axis on.

 

At the top of the page I have a chiclet slicer that has 3 regions. In the default state (nothing selected), I want the chart to display the values for the three Regions in the slicer.

 

When a Region is selected, I want the bar chart to display the values for the Locations in the selected Region.

 

I've tried with calculated columns, parameters, and measures. Does anyone know a way to achieve this?

  • Hi, you need to get inventive here.
    1. Duplicate your original table
    2. Group it by Region and Sum of Sales

    3. Duplicate the region column, rename it to Location. Add a custom column isregion simply writing 1 

    4. Append this table to the original table

    5. Then write a calculation: whatever you are counting/displaying there, i took sales as an example

     

    Sales= if(IsFiltered('Table'[Region]), Calculate(Sum('Table'[Sales]), 'Table'[isregion]<>1), Calculate(SUm('Table'[Sales]), 'Table'[isregion]=1))
    And here we go

    Let me know if you need further explanation




2 Replies