Forum Discussion
Data Labels Position Line chart
- 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
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
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