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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
KKK
Frequent Visitor

Unable to Sync y axis scale of two stacked bar charts

Hi Guys,

I am trying sync the scale for two visual which are prepared from two different dataset but with the same structure.

 

So in the tab "without scale applied", the two stacked bar charts are presented. I want to sync their scale.

 

In the current selection, chart 1 has the maximum y axis value as "3K". and the char 2 has maximum y axis value as "1K". i want to create a measure that returns 3K as so that i apply this value in their scale to make it consistent. the measure i want to create needs to be dynamic and update based on the selection of "Location To" Filter of the slicer.

 

I had created on with the name of "Scale" but that does not seem to be resolving the issue

IMG_20230413_211914__01.jpg

 

 

  Scale measure =

 

Var _Table1 = CALCULATETABLE(SUMMARIZE('Table 1','Table 1'[Year],'Table 1'[Location To],"@Amt",[Total Amount 1]))

 

Var _Table2 = CALCULATETABLE(SUMMARIZE('Table 2','Table 2'[Year],'Table 2'[Location To],"@Amt",[Total Amount 2]))

 

Var _MAXVal_1 = MAXX(_Table1,[@Amt])

 

Var _MAXVal_2 = MAXX(_Table2,[@Amt])

 

Var _FinalMax = SWITCH(TRUE(), _MAXVal_1>_MAXVal_2,_MAXVal_1,_MAXVal_2)

 

REturn

 

_FinalMax

 

the main challenge appears to be negative and i am struggling to eliminate them from my calculation.

 

 Could you guys please help me on this?

 

I had been trying to attach the PBIX file but didn't get the option. Please suggest

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Var _Table1 = CALCULATETABLE(SUMMARIZE('Table 1','Table 1'[Year],'Table 1'[Location To],"@Amt",MAX(0,[Total Amount 1])))

etc

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Var _Table1 = CALCULATETABLE(SUMMARIZE('Table 1','Table 1'[Year],'Table 1'[Location To],"@Amt",MAX(0,[Total Amount 1])))

etc

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.