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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vikramkumawat
Advocate II
Advocate II

Dynamic Legend colours in Stacked column chart

Hi everyone,

I have a stacked column chart in Power BI that shows the sum of Box Office Dollars by Year and Genre. The chart is working well, but I have a new requirement where I need the colors in the legend to dynamically adjust based on the latest year's revenue.

Specifically, I want:

  1. The genre with the highest revenue in the latest year to be colored green.
  2. The genre with the lowest revenue in the latest year to be colored red.
  3. The colors for mid-range values to be dynamically assigned, creating a gradient effect across the revenue spectrum (e.g., transitioning from red to yellow to green).

Here is an example image of the chart I am working with:

vikramkumawat_0-1723111771177.png

 

Is there a way to achieve this in Power BI? Any guidance or workaround would be greatly appreciated!

Thanks in advance for your help!

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @vikramkumawat 

Since stacked or clustered charts don’t support conditional formatting once divided into segments, I doubt it’s feasible. The only trick I know is to leverage the new overlapping functionality, but with complex conditions like yours and more than two categories, it seems like overkill.

For extra assurance, take a look at the video in the link.
https://www.youtube.com/watch?v=MItQGef79Lc


I recommend considering the option of switching to small multiple charts by category. This approach will also be much more readable for users because both stacked charts and conditional formatting involve many elements for the reader's brain to process. Additionally, it will be much easier to apply conditional formatting and highlight what’s needed.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @vikramkumawat 

Since stacked or clustered charts don’t support conditional formatting once divided into segments, I doubt it’s feasible. The only trick I know is to leverage the new overlapping functionality, but with complex conditions like yours and more than two categories, it seems like overkill.

For extra assurance, take a look at the video in the link.
https://www.youtube.com/watch?v=MItQGef79Lc


I recommend considering the option of switching to small multiple charts by category. This approach will also be much more readable for users because both stacked charts and conditional formatting involve many elements for the reader's brain to process. Additionally, it will be much easier to apply conditional formatting and highlight what’s needed.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.