Forum Discussion

harshadrokade's avatar
harshadrokade
Post Partisan
5 years ago
Solved

Measure help required

I want to create a measure wherein if the value comes in a specific range, I want to show that value in text as either "Low" or "Medium" or "High".

 

If value is between 0-30, the value on chart should reflect as Low

If value is between 31-70, the value on chart should reflect as Low

If value is between 71-100, the value on chart should reflect as High

 

Pls help sir..

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi harshadrokade .

     

    You can use

    measure=IF(table name[column name]<=30,"Low",
                     IF(table name[column name]>70,"High","Medium")).

     

    Regards,

    Sanket Bhagwat.

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • harshadrokade, Anonymous's formula will work but I would recommend using SWITCH(TRUE()...) syntax as it tends to be cleaner. Also, place your most likely cases first as this will optimize performance.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi harshadrokade .

     

    You can use

    measure=IF(table name[column name]<=30,"Low",
                     IF(table name[column name]>70,"High","Medium")).

     

    Regards,

    Sanket Bhagwat.

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    harshadrokade, Anonymous's formula will work but I would recommend using SWITCH(TRUE()...) syntax as it tends to be cleaner. Also, place your most likely cases first as this will optimize performance.