Forum Discussion

Parosel's avatar
Parosel
Icon for Helper I rankHelper I
4 years ago
Solved

IF one value then...

Hi, All   I've spent the day trying to figure out how to do this - I thought I was getting somewhere using SWITCH(TRUE() statement but can't seem to get it to work.   The situation is I have a me...
  • amitchandak's avatar
    4 years ago

    Parosel ,  Try a measure like

     

    Sumx(Values(Table[Client]) , Calculate(Switch( True() ,

    [Percent] >= 9.195349, 2000,

    [Percent] >= 8.906977,1800,

    //Add others

    [Percent] >= 6.6 , 200

    ) ) )

     

  • speedramps's avatar
    speedramps
    4 years ago

    @Parosel please consider accepting @amitchandak solution which is tecvhnically better than yours.

     

     @amitchandak shas wisely put the highest value first, because the switch command will trigger when it recahes the first >= true condition.

     

    Whereas @Parosel has tested > and <.   

    This is two times slower and will not be True when the value is =  

     

    Well done @amitchandak  !