Forum Discussion
Conditional Formatting for negative values with 3 conditions
Hi adhumal
Please conisder this solution
Create this measure and drag and drop it to your visual.
the UNICHAR will create the icon for you.
- adhumal26 years agoHelper III
speedramps Thank you. I added the measure provided by you but it only gives me the 'red' icons only. Below is the screenshot
Here is the DAX
MyICON =VAR MYVALUE = [Difference %]RETURNSWITCH(TRUE(),MYVALUE<-100,BLANK(),Myvalue <= -5, UNICHAR(128994), -- green if > -100 and <= -5Myvalue <= -0, UNICHAR(128993), -- yellow if > -5 and <= 0Myvalue <= 100 , UNICHAR(128308), -- red if >0 and <=100BLANK())- nandukrishnavs6 years agoCommunity Champion
Try this
MyICON = VAR MYVALUE = [Difference %] VAR RESULT = IF ( MYVALUE > -1 && MYVALUE <= -0.05, UNICHAR ( 128994 ), IF ( MYVALUE > -0.05 && MYVALUE <= 0, UNICHAR ( 128993 ), IF ( MYVALUE > 0 && MYVALUE <= 100, UNICHAR ( 128308 ), BLANK () ) ) ) RETURN RESULT
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂- adhumal26 years agoHelper III
Thanks for your reply. I used your formula but its showing me below results still (only red icons appear)
- speedramps6 years agoSuper User
Hi again adhumal
In my instructions it did say ...
VAR Myvalue = -4 -- substitute this hard code value with your measure and multiply with 100 if a %but unfortunately you have done this
VAR MYVALUE = [Difference %]
[Difference %] has a percent datatype so 13% will be stored as 0.13and therefore 0.13 is less than 5
If you tweak it will work.
- adhumal26 years agoHelper III
speedrampsI tweaked the formula, but it still gives me the same result. Sorry but I am quite new to this
Here is the DAX that i used
Myicon2 =VAR MYVALUE = [Difference %] * 100RETURNSWITCH(TRUE(),MYVALUE < -100, BLANK(),MYVALUE <= -5, UNICHAR(128994),MYVALUE <= -0, UNICHAR(128993),MYVALUE <= 100, UNICHAR(128308),BLANK())