Forum Discussion
Add Fields to Bar Chart Data Label
Two questions:
1. When creating bar charts, we can enable data label but it only allows us to display the data label for the metric we're using in 'Values'.
In this case, if I'm showing % of students wearing red by grade, then I only get to display the data label for that. Is it possible for me to add other fields to data label? Ex. % of students wearing red by grade (count of students wearing red by grade): 100% (200 students) instead of just 100%.
I know we can add fields to tooltips, but I'm trying to achieve this with data labels.
2. Is it possible to apply a different color to the border of each bar? So it can look more like this:
Thanks!
6 Replies
- parry2kSuper User
Anonymous you can use calculation group to format what you want to show as a data label otherwise nothing from the format pane.
also, 2nd option is possible.
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- AnonymousNot applicable
Thank you. Would you mind giving me some details on how to achieve #2 if it is possible?
- parry2kSuper User
Anonymous as mentioned, not sure if #2 can be achieved.
- AnonymousNot applicable
Hi Anonymous
(1)For your first question , you need to calculate the percentage for each grade and then put the measure or calculated column in Visual Fields .Then you can see the percentage in bar chart .
(2)You can change the color of each bar in Visual Format => Data colors .Turn on “Show all” and change the color manually , or click the fx and set rules for the colors .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi, thank you for answering but unfortunately these are not what I'm looking for.
RE #1: As shown in the above screenshot, I have the percentages in data labels but I want to show a concatenated label like 100% (200 students) instead of just 100%.
RE #2: I'm not trying to apply a different color to every bar, instead, I'm trying to add a border (that is of a darker color) to each bar.
- AnonymousNot applicable
Hi Anonymous
I looked at the visual format settings, and currently it does not support adding a border to the bar, you can distinguish it by setting different colors .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.