Forum Discussion
Need help in Power Bi - Conditional formatting for legend
We have a 100% stacked column chart with Year in x-axis , Duration (Hours) in y-axis and Category as legend.
We have an independent table which has color codes associated with categories, specific color code for each category.
The expectation is to apply conditional formatting for the legend based on this color code field value, so that the categories will have unique, pre-defined colors in the visual. But power bi doesn’t support conditional formatting for legend. Pleas let us know if this could be achieved.
Sample screenshots provided below.
nandhini2607 legend colors are based on the visual colors (in this case bars), if you apply conditional formatting on the visual, legend color will follow that.
- Anonymous2 years ago
Hi parry2k ,thanks for the quick reply, I'll add further.
Hi nandhini2607 ,
Unfortunately, it is now only possible to set conditional formatting for single bar charts. That means stacked charts are not supported.You can vote for the idea here.
https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=5de734fa-3a3f-4228-9aa5-7deebea5615c
1.You can manually set the color of the legend here.
2.Modify your visual objects according to this.(See the .pbix file for more details)
3 Replies
- parry2kSuper User
nandhini2607 legend colors are based on the visual colors (in this case bars), if you apply conditional formatting on the visual, legend color will follow that.
- AnonymousNot applicable
Hi parry2k ,thanks for the quick reply, I'll add further.
Hi nandhini2607 ,
Unfortunately, it is now only possible to set conditional formatting for single bar charts. That means stacked charts are not supported.You can vote for the idea here.
https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=5de734fa-3a3f-4228-9aa5-7deebea5615c
1.You can manually set the color of the legend here.
2.Modify your visual objects according to this.(See the .pbix file for more details)
- nandhini2607New Member
Anonymous Thank you for your valuable inputs