Forum Discussion
Conditional Formatting Data Colours for more than one field in a bar chart not working
When creating a bar chart with two or more fields I noticed that the conditional formatting option dissapears. I really wanted to write a rule that say that if the total is >10 then "green" and if it is <10 then "red". I understand that because there are five measures involved I would need to write five different measures for the colours. Is there any way around this?.
Thanks in advance.
HamidBee since you have seperate column for each field, you wont be able to have conditional formating. In this case, i suggest you to unpivot your data in the power query window so that you have one column for cat and second column for value. once you do this, then you will get option to have conditional formatting
this is how you can unpivot your data
then you can have conditional formatting option enabled.
and this is how you set the conditional formatting
5 Replies
- amitchandak
Super User
HamidBee , with more than one measure or legend conditional formatting is not supported.
But you can make the legend column a second axis column, (expand- concatenate label off, sort on-axis) and use conditional formatting with one measure
If that is possible, refer power bi part in this video
Tableau Vs Power BI- Chapter 4- Bar/Clustered Bar: https://youtu.be/2P5BBRN853c
How to do conditional formatting by measure and apply it on pie?: https://youtu.be/RqBb5eBf_I4
- HamidBee
Power Participant
Thank you, I'll have a watch through the videos.
- Pragati11
Super User
Hi HamidBee ,
Yes currently we don't have that option of using custom measure under Data Colors section for Bar Chart.
You can post an idea here: https://ideas.powerbi.com/ideas/
Thanks,
Pragati
- negi007
Community Champion
HamidBee since you have seperate column for each field, you wont be able to have conditional formating. In this case, i suggest you to unpivot your data in the power query window so that you have one column for cat and second column for value. once you do this, then you will get option to have conditional formatting
this is how you can unpivot your data
then you can have conditional formatting option enabled.
and this is how you set the conditional formatting
- HamidBee
Power Participant
Yes, that did the trick. Thanks