Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
84 | |
83 | |
64 | |
61 | |
55 |
User | Count |
---|---|
171 | |
109 | |
109 | |
73 | |
71 |