Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
nandhini2607
New Member

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_1-1716210855154.png

 

 

nandhini2607_0-1716210828133.png

 

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

Anonymous
Not 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.

vzhouwenmsft_0-1716273023550.png

 

2.Modify your visual objects according to this.(See the .pbix file for more details)

vzhouwenmsft_1-1716273082164.png

 

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not 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.

vzhouwenmsft_0-1716273023550.png

 

2.Modify your visual objects according to this.(See the .pbix file for more details)

vzhouwenmsft_1-1716273082164.png

 

 

 

@Anonymous  Thank you for your valuable inputs

parry2k
Super User
Super 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors