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 August 31st. Request your voucher.

Reply
Imagauthamam
Helper III
Helper III

Data Labels Position Line chart

Hi All,


So, we are using a line chart to show a yearly trend.
2025 and 2026 are the 2 lines which we are plotting in the line chart.
There is an issue in the position of data labels.

Imagauthamam_0-1741765235616.png

BLUE LINE->2026
GREY LINE->2025

The requirement is that lower values should come below the line and higher value should come above the line.
For example, let's consider Week 2 ,27.7 should come below and 29.2 should come above the line. 
To keep it simple, it should be opposite to how it is shown in this picture.
I can achieve this by adjusting data label position, I can keep 2026 line  as Under and 2025 as Above.
But, then if we consider Week 5, the value of 2026 is more than 2025 in this week.
Since I have kept 2026 as under, 42.3 will come below and 39.8 will come above.
I have tried all combinations in modifying the data labels position and I have tried Auto position as well.
Atleast in one of the weeks, the label position always gets misplaced.
Any suggestions on this?


 20252026
Week 1->21.415.8
Week 2->29.227.7
Week 3->34.233.6
Week 4->36.738.2
Week 5->39.842.3
1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Imagauthamam 

The only way I can think of to tackle this is to create a generalised "Year" dimension that branches off from the 'Date' table (assuming you have one), which includes special values "High" and "Low". 

OwenAuger_0-1741931934947.png

 

  • Year[Year Label Display] is used as the legend field (effecitvely hiding values that do not represent actual years).
  • When Year[Year Label] represents an actual year, the original value is plotted on the chart.
  • When Year[Year Label] = "High", the max value (adjusted upwards slightly) is plotted.
  • When Year[Year Label] = "Low", the min value (adjusted downwards slightly) is plotted.
  • The High/Low are just there to display data labels from a specially constructed measure Value Data Label.
  • These data labels can be coloured using a measure Data Label Colour which selects a colour corresponding to the relevant line.

I'll let you look through the PBIX, but the end result looks like this.

OwenAuger_1-1741932129925.png

This solution is rather fiddly to set up and it likely needs adjusting to work in all scenarios. I'm not sure if it's worth the effort to be honest. I wish that the core line chart made this sort of label positioning easier!

 

There might also be something creative you could do with visual calculations 🙂

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

4 REPLIES 4
OwenAuger
Super User
Super User

Hi @Imagauthamam 

The only way I can think of to tackle this is to create a generalised "Year" dimension that branches off from the 'Date' table (assuming you have one), which includes special values "High" and "Low". 

OwenAuger_0-1741931934947.png

 

  • Year[Year Label Display] is used as the legend field (effecitvely hiding values that do not represent actual years).
  • When Year[Year Label] represents an actual year, the original value is plotted on the chart.
  • When Year[Year Label] = "High", the max value (adjusted upwards slightly) is plotted.
  • When Year[Year Label] = "Low", the min value (adjusted downwards slightly) is plotted.
  • The High/Low are just there to display data labels from a specially constructed measure Value Data Label.
  • These data labels can be coloured using a measure Data Label Colour which selects a colour corresponding to the relevant line.

I'll let you look through the PBIX, but the end result looks like this.

OwenAuger_1-1741932129925.png

This solution is rather fiddly to set up and it likely needs adjusting to work in all scenarios. I'm not sure if it's worth the effort to be honest. I wish that the core line chart made this sort of label positioning easier!

 

There might also be something creative you could do with visual calculations 🙂

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Thanks @OwenAuger  for coming up on this.
As you rightly pointed out, this might need adjustments in certain situations.
Power BI should work to develop something on this

Imagauthamam
Helper III
Helper III

Hi @amitchandak ,
I have the current version. The reason your graph works is that your line charts are separate and do not overlap. Therefore, the above and Under option will work for you. However, in my case, the 2026 line is high in some weeks, while the 2025 line is high in other weeks. The offset options also doesn't help much in my case

amitchandak
Super User
Super User

@Imagauthamam , In the Latest version of Power BI. You can choose each series under the label and change its position under options

amitchandak_0-1741813817681.png

 

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

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.