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 Anusha_Banda ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
color = IF(MAX('Table'[sales])>0 && SELECTEDVALUE('Table'[type])="y","green","red")
(3)Set the conditional formatting as shown in the following figure.
(3) Then the result is as follows.
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.