Forum Discussion
Imagauthamam
Helper III
1 year agoData 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. BLUE...
- 1 year ago
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".
- 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.
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
amitchandak
Super User
1 year agoImagauthamam , In the Latest version of Power BI. You can choose each series under the label and change its position under options