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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
jalaomar
Helper IV
Helper IV

Conditional formatting dates values

Hello,

 

Hope you can support with the following question. I have a Planned dates field and currently applied the following conditional formatting but would like to add some more to it.

 

1. How can I ensure that the blank rows are not highlighted?

2. is it possible to apply conditional formatting based on days to completion? meaning if it's 7 days left to planned date then show yellow, if it's passed planned date then show red and if it's more than 7 days left then show green?

2. How can I adjust the font color? if red, then font color should be white, yellow & green = font color should be black

 

Color Date = if(FIRSTNONBLANK('QA Plan'[Planned_Completion_Date],TODAY()) <today(),"red","lightgreen")
 
2022-08-01_15-40-26.png
 
Thanks!
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @jalaomar 

Thanks for reaching out to us.

you can try this,  create the measures below,

Measure1 = 
var _t1= MIN('Table'[Planned Date])
var _diff=DATEDIFF(TODAY(),_t1,DAY)
return SWITCH(TRUE(),
ISBLANK(_t1),"white",
_diff<0,"red",
_diff<=7,"yellow",
_diff>7,"green")

vxiaotang_1-1661494042603.png

Measure2 = IF([Measure1]="red","white")

vxiaotang_3-1661494311165.pngvxiaotang_4-1661494319126.png

result

vxiaotang_5-1661494329596.png

 

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @jalaomar 

Thanks for reaching out to us.

you can try this,  create the measures below,

Measure1 = 
var _t1= MIN('Table'[Planned Date])
var _diff=DATEDIFF(TODAY(),_t1,DAY)
return SWITCH(TRUE(),
ISBLANK(_t1),"white",
_diff<0,"red",
_diff<=7,"yellow",
_diff>7,"green")

vxiaotang_1-1661494042603.png

Measure2 = IF([Measure1]="red","white")

vxiaotang_3-1661494311165.pngvxiaotang_4-1661494319126.png

result

vxiaotang_5-1661494329596.png

 

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@jalaomar , Try like

Color Date = if(Max('QA Plan'[Planned_Completion_Date]) <today(),"red","lightgreen")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

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.