Forum Discussion

Anusha_Banda's avatar
Anusha_Banda
Regular Visitor
3 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    3 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.