Forum Discussion
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 Sales3. 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 goLet me know if you need further explanation
2 Replies
- amitchandak
Super User
lg1551 , you can check if bookmarks can help
or you can explore if field parameters can help
Bookmarks
https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive
https://docs.microsoft.com/en-us/power-bi/desktop-bookmarks
https://www.youtube.com/watch?v=PTOJC42rg_kPower BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9afd
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
Field Parameters- Conditional Formatting - olgad
Resident Rockstar
Hi, you need to get inventive here.
1. Duplicate your original table
2. Group it by Region and Sum of Sales3. 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 goLet me know if you need further explanation