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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
RaMiRo87
Frequent Visitor

Dynamic y-axis bar chart - prevent data labels from overlapping

Hi folks,

 

I have a problem with overlapping data labels in my bar charts and need urgently help! 

My problem is certainly of a rather simple nature, but I have not yet been able to find a 100% suitable topic in the community.

 

The data labels are no longer displayed above the respective column for the maximum values, but are either written in the column or half and half. Both variants are known to be illegible.

 

One of my bar charts contains the sales regions [Legal Entity] on the X-axis and the incoming orders [Incoming Orders] on the Y-axis. The bar charts are filtered by a period slicer (MTD, YTD etc.). The column [Legal Entity] and [Incoming Orders] both originate from the fact table 'fcontrolling'.

 

Now I would like that when I select different periods via my slicer, the scales of the column charts are dynamically adjusted to the highest value within this filtered period and there is always a little whitespace above and below the columns so that there is enough space for the data labels.

 

Many thanks for your help in advance!

 

Best regards
Ramirez

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@RaMiRo87 , Ideally it should adjust , if you are using field parameters to switch measures

 

else create min and max like

 

min = minx(Values([Legal Enity), [Your measure] )*.9

 

max = maxx(Values([Legal Enity), [Your measure] )* 1.1

 

 

and use them in Y-axis Min/Max values  

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

View solution in original post

Anonymous
Not applicable

Hi, @RaMiRo87 

You can define a measure of the maximum value of the Y-axis, which depends on the field or measure used by your Y-axis. I created a sample as follows:

vjianpengmsft_0-1713839974298.png

vjianpengmsft_1-1713840003441.png

At this point, 900 is inside the column, and here are the steps to adjust it:

Visual>>Y-axis>>Turn off Logarithmic scale

vjianpengmsft_2-1713840133462.png

Create a measure based on the field or measure you use on the Y-axis. The purpose of the entire maximum value is to allow the maximum value to be displayed on the Y axis higher than your actual maximum value.

Max y-axis = [Sum of sales]*1.1 

Click Maximum fx

vjianpengmsft_3-1713840413624.png

vjianpengmsft_4-1713840433271.png

vjianpengmsft_5-1713840496559.png

In your case, your DAX expression should look something like this:

MaxValue =
CALCULATE (
    MAX ( 'fcontrolling'[Incoming Orders] ),
    ALLSELECTED ( 'fcontrolling' )
) * 1.1

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

4 REPLIES 4
Anonymous
Not applicable

Hi, @RaMiRo87 

You can define a measure of the maximum value of the Y-axis, which depends on the field or measure used by your Y-axis. I created a sample as follows:

vjianpengmsft_0-1713839974298.png

vjianpengmsft_1-1713840003441.png

At this point, 900 is inside the column, and here are the steps to adjust it:

Visual>>Y-axis>>Turn off Logarithmic scale

vjianpengmsft_2-1713840133462.png

Create a measure based on the field or measure you use on the Y-axis. The purpose of the entire maximum value is to allow the maximum value to be displayed on the Y axis higher than your actual maximum value.

Max y-axis = [Sum of sales]*1.1 

Click Maximum fx

vjianpengmsft_3-1713840413624.png

vjianpengmsft_4-1713840433271.png

vjianpengmsft_5-1713840496559.png

In your case, your DAX expression should look something like this:

MaxValue =
CALCULATE (
    MAX ( 'fcontrolling'[Incoming Orders] ),
    ALLSELECTED ( 'fcontrolling' )
) * 1.1

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

Hi @Anonymous,

 

thank you very very much for the detailled description! 

 

Especially your measure was nice to compare it to my current solution. 🙂

 

Thanks a lot!

amitchandak
Super User
Super User

@RaMiRo87 , Ideally it should adjust , if you are using field parameters to switch measures

 

else create min and max like

 

min = minx(Values([Legal Enity), [Your measure] )*.9

 

max = maxx(Values([Legal Enity), [Your measure] )* 1.1

 

 

and use them in Y-axis Min/Max values  

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

Hi @amitchandak,

 

shoul do the trick. Thank you very much for your quick response! 🙂

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.