March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi
I have a list of Due Dates in a column 'AP Report (2)'[Due Date]
I need to colour these based on the following=
If date has passed or due in the next 7 days = red
Date 2 weeks to 1 month = Orange
Date > 1 month = Green
Would anyone be able to advise me how to acheive this?
Solved! Go to Solution.
Create a measure
Color =
VAR _due_date =
SELECTEDVALUE ( 'AP Report (2)'[Due Date] )
VAR _days =
DATEDIFF ( TODAY (), _due_date, DAY )
VAR _result =
SWITCH ( TRUE (), _days < 7, "Red", _days < 30, "Orange", "Green" )
RETURN
_result
Then use this measure in conditional formatting. (Format style by Field value).
Create a measure
Color =
VAR _due_date =
SELECTEDVALUE ( 'AP Report (2)'[Due Date] )
VAR _days =
DATEDIFF ( TODAY (), _due_date, DAY )
VAR _result =
SWITCH ( TRUE (), _days < 7, "Red", _days < 30, "Orange", "Green" )
RETURN
_result
Then use this measure in conditional formatting. (Format style by Field value).
Should that be _days in the switch statement instead of _due_date?
@kleigh wrote:Should that be _days in the switch statement instead of _due_date?
That was it, fixed now 🙂
This is giving me everything as a Green status
16th August should be Red?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |