Forum Discussion
GL10
1 year agoNew Member
PowerBI Measure for Colouring Date Ranges
Hi, I'd appreciate some help with the following measure. I'm looking to colour the date value as follows: Red - Target Date has passed - Value "2" Amber - Target Date is due withing 5 days - Val...
- 1 year ago
Days that are in the future will have a negative difference with today, try
Colour = VAR _day = DATEDIFF ( MAX ( 'Sheet1'[Target Date] ), TODAY (), DAY ) RETURN SWITCH ( TRUE (), _day <= 0 && _day >= -5, 1, _day < -5, 0, _day > 0, 2 )
johnt75
1 year agoSuper User
Days that are in the future will have a negative difference with today, try
Colour =
VAR _day =
DATEDIFF ( MAX ( 'Sheet1'[Target Date] ), TODAY (), DAY )
RETURN
SWITCH ( TRUE (), _day <= 0 && _day >= -5, 1, _day < -5, 0, _day > 0, 2 )
GL10
1 year agoNew Member
Amazing, that worked perfectly. Thank you so much for your help.