Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
lg1551
Resolver II
Resolver II

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?

1 ACCEPTED SOLUTION
olgad
Resident Rockstar
Resident Rockstar

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

olgad_0-1676642390557.png

olgad_1-1676642413977.png

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

olgad_3-1676642498558.png

4. Append this table to the original table

olgad_4-1676642558636.png

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
olgad_5-1676642647121.pngolgad_6-1676642671283.png

Let me know if you need further explanation





DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

2 REPLIES 2
olgad
Resident Rockstar
Resident Rockstar

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

olgad_0-1676642390557.png

olgad_1-1676642413977.png

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

olgad_3-1676642498558.png

4. Append this table to the original table

olgad_4-1676642558636.png

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
olgad_5-1676642647121.pngolgad_6-1676642671283.png

Let me know if you need further explanation





DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
amitchandak
Super User
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_k

 

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
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

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.