The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Solved! Go to Solution.
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
Post edited to correct table reference in the measure
thanks @Anonymous
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
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
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
Post edited to correct table reference in the measure
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
79 | |
72 | |
48 | |
39 |
User | Count |
---|---|
138 | |
108 | |
69 | |
64 | |
57 |