Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I am trying to match the scales of two line charts to match based on the filter selected but not sure how to make it dynamically? Any help is appreciated:
Thanks in advance.
Oddly enough, SQLBI just posted a video on this problem: Using DAX to control a chart range in Power BI
Hi although the post is quite old maybe somebody still has the same issue.
I had a similar problem. Two charts showing quantities for different versions of some market data. eg. market numbers and a certain quantity for the same time period from two different base tables
In order to compare it probably visually the maximum of the y axis needed to be the same.
I solved it with an additional measure in one of the tables finding out the max of a measure I used the MAXX formula to be able to use a measure as the base line.
If the other table has higher values you could also nest it in an if function to cover such a situation to take whatever number is the bigger one.
Hope this helped.
I found a solution that worked for me. Here's what I put into a measure that I then used as a maxium for both tables:
AxisNum =
VAR totalPrev = SUM(Labor_A_Previous[Hours])
VAR totalCurrent = SUM(Labor_A_Current[Hours])
VAR P1 = IF(totalPrev<1,3,IF(totalPrev<5,10,IF(totalPrev<20,15,IF(totalPrev<50,20,IF(totalPrev<100,50,IF(totalPrev<500,100,IF(totalPrev<1000,500,750)))))))
VAR C1 = IF(totalCurrent<1,3,IF(totalCurrent<5,10,IF(totalCurrent<20,15,IF(totalCurrent<50,20,IF(totalCurrent<100,50,IF(totalCurrent<500,100,IF(totalCurrent<1000,500,750)))))))
RETURN
IF([Hour_CurrentYr]>[Hour_PrevYr],totalCurrent+C1,totalPrev+P1)
After that, I sized the tables similarily and only had minimal spacing issues with the y-axis. I made the IF statements so that I wasn't using just a blanket number to increase by.
I found following useful:
Set the range of the y Axis to be dependent on a certain field. You can do this for both the minimum and maximum range by clicking on the "fx" button.
Below a dummy figures example: One YTD Sales bar chart and one QTD Sales bar chart. If you want the QTD bars are dynamically adjusted based on the YTD bars, click on Format your visual -> Y-axis -> Maximum -> fx -> What field should we base this on? -> Sales YTD.
Hope this helps
bump
Hi @natabird3 ,
I'm not sure I got you. You want that the scales of Y-axis is same as the other visual's whenever filtered. Right? If so, you could set a same fixed scale in the Y-axis of two visuals.
Otherwise, you could put the data into one chart and create a double Y-axis to show. You could reference the videos to have a try.
R Visuals in Power BI - Dual Y-Axis Line Chart
We can't directly implement match scales dynamically. Hope the two workarounds will help you.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Kudos are nice too.
Sorry but it is not what i asked. I have two charts and not one with two scales. If i have the chart above and the chart below, each has its own scale. I want the scale to be the same for both when filtering. If i set it manually it wont be dynamic and in most cases will be hard to see the data as it varies a lot when filtering so is not an option. Changes need to be automatic and dynamic. Therfore, i think it might be somehting not supported currently in Power Bi. As there is no way to link two visuals with one another as far as i know.
Hi @natabird3 ,
You are right. It is not supported for now. I find a similar idea. Maybe you could vote it up and submit comments to get it fixed quickly.
Enable auto scale axis sync across charts/graphs
Hope this will help you a little.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
It's a couple years later - is there a solution for this yet? Seems so simple
User | Count |
---|---|
122 | |
76 | |
63 | |
51 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |