Forum Discussion
afloyd2123
4 years agoFrequent Visitor
Dynamic Conditional Formatting: Green text for YOY growth, Red text for YOY decline
Hi team, I'd like to use dynamic conditional formatting to show green text for YOY (year over year) growth and red text for a YOY decrease. For example: 2022 Total Department is less than it was i...
- 4 years ago
sorry, I gave you a bad DAX measure
Try this ...
Click here to download a solutionRAG colour =
VAR myyear = SELECTEDVALUE(yourtable[Year])
VAR prevyear = myyear -1VAR myval = SUM(yourtable[Value])
VAR prevval =CALCULATE(SUM(yourtable[Value]),ALL(yourtable),yourtable[Year] = prevyear )RETURNIF( myval >= prevval, "Green", "Red")
afloyd2123
4 years agoFrequent Visitor
Perhaps it was user error but I struggled to get that equation to work. I eventually created a Prior_Year measure, then an IF(Current_Year > Prior_Year, "Green", "Red"). Then using that measure as a field value for the font color within conditional formatting,