Forum Discussion
Customize Column Colors in Stacked Column based on Date
- 3 years ago
Hi denemee123
The stacked column chart doesn't let you set the column colors in this way. You can only choose set colors for each category.
regards
Phil
- 3 years ago
Hi denemee123
Download example PBIX file with charts etc shown below
If you want to set the column colors based on whether they are in the past or future, then you don't want to see each category in a different color?
In which case you can use a Clustered Column or a Stacked Column, plot the data for all categories in one column, per year, and use a Conditional Formatting rule to set the column colors accordingly.
Write a measure like this
Column Color = IF(MAX('DataTable'[Date]) < TODAY(), "#0F0", "#F00")Format the visual : select fx to create a Conditional Formatting rule
Here is the rule
Giving this
Note 1 I when I took this screenshot I had red dates in the past, green for the future. You want it the other way around. The measure (above) to set the color does it as you want. It's easy to change. Red is "#F00", green is "#0F0"
Note 2 this is a Line & Stacked Column chart and it's only plotting the Sum of value on the y-axis.
Regards
Phil
Hi denemee123
Download example PBIX file with charts etc shown below
If you want to set the column colors based on whether they are in the past or future, then you don't want to see each category in a different color?
In which case you can use a Clustered Column or a Stacked Column, plot the data for all categories in one column, per year, and use a Conditional Formatting rule to set the column colors accordingly.
Write a measure like this
Column Color = IF(MAX('DataTable'[Date]) < TODAY(), "#0F0", "#F00")
Format the visual : select fx to create a Conditional Formatting rule
Here is the rule
Giving this
Note 1 I when I took this screenshot I had red dates in the past, green for the future. You want it the other way around. The measure (above) to set the color does it as you want. It's easy to change. Red is "#F00", green is "#0F0"
Note 2 this is a Line & Stacked Column chart and it's only plotting the Sum of value on the y-axis.
Regards
Phil
- denemee1233 years agoNew Member
Thank you for yor effort 🙂 I got it.