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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Saghar
Frequent Visitor

Dynamic Y-axis range

Hello everyone,

I'm using line and clustered column chart in Power BI Desktop with a live connection to data source and some slicers.
The annoying thing is that the lines are shown on the columns which makes it difficult to read the data labels, I'm searching for a way to show the lines above columns so that they don't overlap. One solution is to change the Y axis range manually and say e.g. show only the range o to 100, BUT that doesn't solve it completely because once I change one filter via slicer 100 is smaller than maximum value and the chart gets messed up.
Does any one have a smart solution to adjust the start and end values of Y-axis dynamically?

Thanks in advance 🙂

4 REPLIES 4
Greg_Deckler
Super User
Super User

@Saghar - Perhaps you could create a measure for your line that takes the maximum value in the columns and adds that to each of your line values and then turn off the secondary axis. What do you think of that?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler thanks for the suggestion, the problem is that line and column measures have different formats (€ and %) and I can't think of a smart way to compare those two (to add the maximum of columns to the lines).
Do you have a solution to that as well? 🙂

Hi @Saghar ,

 

Maybe you can open the second Y axis for column chart and line chart.

And you can customize Data label to distinguish them.

Perhaps you can add a background to the Data label of the Column, the result like this,

 

dynamic1.jpg

 

If you have any question, please kindly ask here and we will try to resolve it.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Saghar , I doubt there is a solution for that. Auto is one which not working for.

 

There a few solutions. multi-axis visual - idea for that

Line and Bar chart with Multiple Axis
https://ideas.powerbi.com/ideas/idea/?ideaid=cc9b1531-8ca4-48be-8035-b6dfc17af84f
https://ideas.powerbi.com/ideas/idea/?ideaid=aec20fda-edc4-466c-a9c0-2772011f6193

 

You can vote or create a new idea.

https://appsource.microsoft.com/en-us/marketplace/apps?product=power-bi-visuals

You can explore some custom visual -

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.