The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
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?
2025 | 2026 | |
Week 1-> | 21.4 | 15.8 |
Week 2-> | 29.2 | 27.7 |
Week 3-> | 34.2 | 33.6 |
Week 4-> | 36.7 | 38.2 |
Week 5-> | 39.8 | 42.3 |
Solved! Go to Solution.
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".
I'll let you look through the PBIX, but the end result looks like this.
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
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".
I'll let you look through the PBIX, but the end result looks like this.
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
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
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
@Imagauthamam , In the Latest version of Power BI. You can choose each series under the label and change its position under options