Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a column in a table on my visual. with a date in it (some blanks). I need to color code the dates showing as follows
1. Dates 30 days out from todays date in Red (also some dates will be in the past)
2. Dates between 31 and 60 days in Yellow.
3. Dates from 61+ in Green.
Please help I have tried many things but just cannot get it to show correctly. I know it has something to do with the measure I am using.
Solved! Go to Solution.
Try this:
Date Logic =
var days = DATEDIFF(TODAY(), Table[DateColumn], DAY)
RETURN
IF(days >= 61, "Green", IF(days >= 31 && days < 61, "Yellow", "Red"))
Proud to be a Super User!
Try this:
Date Logic =
var days = DATEDIFF(TODAY(), Table[DateColumn], DAY)
RETURN
IF(days >= 61, "Green", IF(days >= 31 && days < 61, "Yellow", "Red"))
Proud to be a Super User!
I am not sure where to enter that formula, Forgive my ignorance.
No worries, that's why this forum exists 😀
Go to Home tab and find "New Measure"
In the Table[DateColumn] part just replace them with how they are named in your data.
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |