Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
marshall
Regular Visitor

help on simple DAX formula to recode numbers into text

Hi,

How do I create a calculated formula for this.... if the score in value column is equal to 1 or 2 then the formula should return "Low", if the value is 3 then it should return "Moderate", if the value is 4 or 5, then it should return a "High"

 

Value

1  ----> Low

2  ----> Low

3  ----> Moderate

4 ----> High

5  ----> High

 

Thank you very much for your help.

3 ACCEPTED SOLUTIONS
Zubair_Muhammad
Community Champion
Community Champion

@marshall

 

You can use this column

 

Column =
SWITCH (
    TRUE (),
    Table1[Value] IN { 4, 5 }, "High",
    Table1[Value] = 3, "Moderate",
    Table1[Value] IN { 1, 2 }, "Low",
    "Unspecified"
)

Regards
Zubair

Please try my custom visuals

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF(Data[Value]<=2,"Low",IF(Data[Value]=3,"Moderate","High"))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

thank you very much. It works!:-)

View solution in original post

7 REPLIES 7
Bbrown44
Advocate II
Advocate II

Is there a way to do this in query editor?

Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=IF(Data[Value]<=2,"Low",IF(Data[Value]=3,"Moderate","High"))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

thank you very much. This one also works!:-)

Zubair_Muhammad
Community Champion
Community Champion

@marshall

 

You can use this column

 

Column =
SWITCH (
    TRUE (),
    Table1[Value] IN { 4, 5 }, "High",
    Table1[Value] = 3, "Moderate",
    Table1[Value] IN { 1, 2 }, "Low",
    "Unspecified"
)

Regards
Zubair

Please try my custom visuals

Really liked the combination of switch and IN operator

thank you very much! it works!:-)

thank you very much. It works!:-)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.