Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 in 2021. Therefore, I'd like to show the text (109) in red.
Thank you!
Solved! Go to Solution.
sorry, I gave you a bad DAX measure
Try this ...
Click here to download a solution
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,
sorry, I gave you a bad DAX measure
Try this ...
Click here to download a solution
Try my original solution again
but take care to follow the instructions on the conditional formating screen
If you can get it working I will creart an example .... but please try DIY thank you !
Try this ...
add a measure ....
RAG colour =
VAR myyear = SELECTEDVALUE(yourtable[year])
VAR prevyear = myyear -1
VAR myval = SUM(yourtable[value])
VAR prevval = CALCULATE( SUM(yourtable[value]), yourtable[year]) = prevyear)
RETURN
IF( myval >= prevval, "Green", "Red)
in conditaional formating select font, format style, = Field Value, RAG colour
Please click thumbs up and accept as solution buttons for such a quick reply. Thanks 😀
It seems that I can't select a measure when I'm using Field Value. Only non-summarized columns.
In that case, you can have [RAG color] output 1 or 2 (instead of "Green" or "Red") and then use those to format by Rules (instead of Field value)
When I submit what is pictured I receive the error below.
MdxScript(Model) (337, 5) Calculation error in measure 'Premium'[RAG colour]: DAX comparison operations do not support comparing values of type Integer with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values.
The error seems to indicate that [RAG color] is outputting True or False instead of 1 or 2.
User | Count |
---|---|
112 | |
71 | |
57 | |
44 | |
39 |
User | Count |
---|---|
176 | |
125 | |
61 | |
60 | |
58 |