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
denemee123
New Member

Customize Column Colors in Stacked Column based on Date

Hi,

 

I want to customize column colors based on date field. I use stacked column chart in my project, in shared axis there are 2 different field (date and job names). For column values, I try to change colors of columns according to date, i.e. for future I want to see column color as red, for past I want to get column color as green. Below figure is just an example. 

denemee123_1-1667202694693.png

Thank you for your help. 

2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

PhilipTreacy
Super User
Super User

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

formviz.png

 

Here is the rule

formviz2.png

 

Giving this

formviz3.png

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

5 REPLIES 5
MadsD
Advocate I
Advocate I

Hi! Try to go to Visual - Columns - Colors and then each category should have a color to assign to.

MadsD_0-1712571533727.png

 

PhilipTreacy
Super User
Super User

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

formviz.png

 

Here is the rule

formviz2.png

 

Giving this

formviz3.png

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thank you for yor effort 🙂 I got it.

PhilipTreacy
Super User
Super User

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



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy ,

 

Thank you for your reply. Well, is there any visual to apply what I want in PowerBI?

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