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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Sean-OReilly
Helper IV
Helper IV

How Do I Conditional Format a Date to go Red if before Today's date?

Hi

How Do I Conditional Format a Date to go Red if before Today's date?

 

Here is my sample data - If End Date is before Today, i want it to go Red.

SeanOReilly_0-1675268038501.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can create a measure like this 

 

 

 

 

Colour_Date = 
VAR date_diff = DATEDIFF(TODAY(), MAX('Table'[End_Date]), DAY)
RETURN
    IF (date_diff < 0, "#C81517")

 

 

 

and then apply it as a conditional format to the column. The "#C81517" is HEX code so can be changed to a different red if you want

reidnmorrison_0-1675268940890.png

Post edited to correct table reference in the measure 

 

View solution in original post

4 REPLIES 4
Sean-OReilly
Helper IV
Helper IV

thanks @Anonymous 

Sean-OReilly
Helper IV
Helper IV

Thanks @Anonymous 

How do I turn my End Date into a measure? At the minute it is just a field within a table and i can't bring it into the formula like you have done above

Anonymous
Not applicable

That should be a column reference not a Measure, I misread the column name. If you replace [End Date] with 'Table'[End_Date] that will do the trick. I'll edit the other reply to show that

Anonymous
Not applicable

You can create a measure like this 

 

 

 

 

Colour_Date = 
VAR date_diff = DATEDIFF(TODAY(), MAX('Table'[End_Date]), DAY)
RETURN
    IF (date_diff < 0, "#C81517")

 

 

 

and then apply it as a conditional format to the column. The "#C81517" is HEX code so can be changed to a different red if you want

reidnmorrison_0-1675268940890.png

Post edited to correct table reference in the measure 

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.