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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Igotzepowerbi
Frequent Visitor

Conditional Formatting for color coding Date

Jolly Monday,

I need to color code by the requested ship date. For example, if it is within next 5 days color code it yellow and if it is within 6-10 days, color it green. I am trying to do this  with conditional formatting but am getting very lost. Could someone help with how I can accomplish this? 

Igotzepowerbi_0-1692021615828.png

Thanks so much!! 🙂

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Igotzepowerbi 

You can achieve it with 2 steps :

1. Create a dax for your condition, for example:

Condition =
IF(SELECTEDVALUE('ship dates'[Ship date])>today()+5 && SELECTEDVALUE('ship dates'[Ship date])<today()+10,1,
IF(SELECTEDVALUE('ship dates'[Ship date])>today()+10,2
))
Ritaf1983_0-1692073037699.png

 

2. choose the column that you want to format on your visual table and modify the format according to results of the Dax measure
Ritaf1983_1-1692073091113.png

Result :

Ritaf1983_2-1692073207555.png

 

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 @Igotzepowerbi 

You can achieve it with 2 steps :

1. Create a dax for your condition, for example:

Condition =
IF(SELECTEDVALUE('ship dates'[Ship date])>today()+5 && SELECTEDVALUE('ship dates'[Ship date])<today()+10,1,
IF(SELECTEDVALUE('ship dates'[Ship date])>today()+10,2
))
Ritaf1983_0-1692073037699.png

 

2. choose the column that you want to format on your visual table and modify the format according to results of the Dax measure
Ritaf1983_1-1692073091113.png

Result :

Ritaf1983_2-1692073207555.png

 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.