Forum Discussion
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.
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.
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!
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.
Please see the attached pbix.
2 Replies
- danextianSuper 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.
Please see the attached pbix.