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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Line and stacked column chart: lock y-axis scales to be same

Is it possible to force both the columns/bars and the line to use the same y-axis (or lock the primary and secondary y-axis scales to be the same)?  

 

I'm able to make both of them start (min) from 0.

 

It's the top end of the scale (max) which can't be hard coded b/c there are slicers which require a dynamic scaling. 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

After my research,all we can do now is to fine-tune the following parameters in the visual format to get the result we want.

x.png08.pngy.png

 

Before:

before.png

After:

result.png

 

In addition , you can come up with/ vote for a  idea and add your comments there to make this feature better. https://ideas.powerbi.com/forums/265200-power-bi-ideas

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/30928009-allow-use-of-variable-for-y-axis-scale

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

8 REPLIES 8
Thomas_td
Frequent Visitor

I think a lot of people looking for a solution on this topic might benefit from this solution: Solved: I would like to create a bar graph with a target l... - Microsoft Power BI Community

It worked for me!

treborg
Frequent Visitor

Highlighting a field by using a line graph is surely a very common use case  - profit per revenue in this example - or in my case a target line. You probably don't want to have to set manual limits to two sets of axes - you just want to use the same axis.

This illustrates the problem. I have online sales as the bar chart and target percent as the line graph. They are obviously on the same scale but here, Power BI has decided to use 0-100% on the left axis and 12-18% on the right axis - making the line meaningless.. 

 

treborg_0-1627639861947.png

 

You can use the formula button and set the max for both to the same field value from the data table. They should be in the same scale after. You choose to turn on or off the secondary axis depending on your preference.

Agreed, that is the same solution I came up with and it works perfectly.

v-easonf-msft
Community Support
Community Support

Hi , @Anonymous 

After my research,all we can do now is to fine-tune the following parameters in the visual format to get the result we want.

x.png08.pngy.png

 

Before:

before.png

After:

result.png

 

In addition , you can come up with/ vote for a  idea and add your comments there to make this feature better. https://ideas.powerbi.com/forums/265200-power-bi-ideas

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/30928009-allow-use-of-variable-for-y-axis-scale

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

What if you do not want to keep a fixed End for both Y-axis? 

parry2k
Super User
Super User

@Anonymous unfortunately you cannot have dynamic scaling, either you have to manually enter a value which you know will not work or you have to work with the default scale. I think there is an idea on the ideas forum in which you should vote if there is none, create a new idea.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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