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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Stino
Regular Visitor

Clustered column chart - random column colors

Hi all,

 

First post here. Hopefully anyone can be of help. 

 

In my report, I am using a Clustered column chart with 2 columns per item. Each column represents a specific date.

The underlying data comes from two files that I combined into one table, and the 'Date' column is used as the Legend.

Stino_2-1754294512774.pngStino_3-1754294618986.png

Every time the dates change (for example, one dataset is updated), the legend updates correctly, but the color assigned to each date changes randomly. See below, the date changed to 3-8-2025, which randomizes the color of the columns.

Stino_0-1754294384987.png

Is there a way to format the visual so that the first date always has color X and the second date (the later date) always has color Y?

As you can see in the image above, the ‘fx’ conditional formatting option is not available for the data colors on this chart.

 

Thanks!

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Stino 

 

What you're seeing is expected behavior for column charts with legends - colors are assigned per series, not based on which values are currently visible or their order. A workaround is to assign fixed legend values, like 1 for the latest date and 2 for the previous one. Then, hide the legend and create a matrix visual styled to resemble a legend, using a DAX-generated SVG for custom conditional formatting. This gives the impression that colors are applied dynamically based on visible dates. However, the illusion breaks when you hover over the actual column chart as you will see the actual legend value.

danextian_0-1754316390731.gif

danextian_1-1754316457855.png

 

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
Stino
Regular Visitor

Hi @danextian ,


Thank you for your response. I managed to create a workaround.

I used the 'DatePosition' formula of your pbix file and made a custom formula using MIN and MAX.


This seems to be the best workaround for my situation.

Thanks again.

danextian
Super User
Super User

Hi @Stino 

 

What you're seeing is expected behavior for column charts with legends - colors are assigned per series, not based on which values are currently visible or their order. A workaround is to assign fixed legend values, like 1 for the latest date and 2 for the previous one. Then, hide the legend and create a matrix visual styled to resemble a legend, using a DAX-generated SVG for custom conditional formatting. This gives the impression that colors are applied dynamically based on visible dates. However, the illusion breaks when you hover over the actual column chart as you will see the actual legend value.

danextian_0-1754316390731.gif

danextian_1-1754316457855.png

 

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors