Forum Discussion
Anusha_Banda
3 years agoRegular Visitor
Two rules for a KPI
Hello beautiful people, I have a scenario, not sure how to proceed further. I have a KPI which changes its color depending upon the value (Green if positive and red for negative). Now I have a t...
- Anonymous3 years ago
Hi analytics-ecoma ,
Please try it:
color = SWITCH(TRUE(), MAX('Table'[sales])>0 && SELECTEDVALUE('Table'[type])="x","green", MAX('Table'[sales])<0 && SELECTEDVALUE('Table'[type])="x","red", MAX('Table'[sales])>0 && SELECTEDVALUE('Table'[type])="y","red", MAX('Table'[sales])<0 && SELECTEDVALUE('Table'[type])="y","green", "white")Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi analytics-ecoma ,
Please try it:
color = SWITCH(TRUE(),
MAX('Table'[sales])>0 && SELECTEDVALUE('Table'[type])="x","green",
MAX('Table'[sales])<0 && SELECTEDVALUE('Table'[type])="x","red",
MAX('Table'[sales])>0 && SELECTEDVALUE('Table'[type])="y","red",
MAX('Table'[sales])<0 && SELECTEDVALUE('Table'[type])="y","green",
"white")
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
analytics-ecoma
3 years agoFrequent Visitor
Thanks Neeko, this solution worked. Thank you so much 🙂