Forum Discussion
Conditional formatting measure not working
- Anonymous1 year ago
Hi ,
The TestValues variable should get the Dynamic_Recent value. Try using the following dax formula.
ValueColor = VAR TestAve = [AverageValue] VAR TestStdDev = [StdDevValue] VAR TestValue = SELECTEDVALUE('Unpivot Data'[Value], BLANK()) RETURN SWITCH( TRUE(), ISBLANK(TestValue), "#FFFFFF", -- White color for blank values TestValue >= TestAve + TestStdDev, "#53E17E", TestValue >= TestAve + 0.5 * TestStdDev && TestValue < TestAve + TestStdDev, "#FFFF47", TestValue >= TestAve - TestStdDev && TestValue < TestAve + 0.5 * TestStdDev, "#FFB700", TestValue <= TestAve - TestStdDev, "#FF1414", "#FFFFFF" -- Default to white if none of the conditions are met )Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello JoshP11
Fix: Add a condition to check both ISBLANK() and if the value equals an empty string ("").
SWITCH(
TRUE(),
ISBLANK(TestValue) || TestValue = "", "#FFFFFF", -- White for blanks
TestValue >= TestAve + TestStdDev, "#352E1E",
TestValue >= TestAve + 0.5 * TestStdDev && TestValue < TestAve + TestStdDev, "#FFFF47",
TestValue >= TestAve - TestStdDev && TestValue < TestAve + 0.5 * TestStdDev, "#FFB700",
TestValue <= TestAve - TestStdDev, "#FF1414",
"#FFFFFF" -- Default white)
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
Hello dharmendars007 - thank you for your suggestion!
Its now showing this error, any ideas?
Thanks,
Josh