Forum Discussion

jamieham's avatar
jamieham
Icon for Helper II rankHelper II
3 years ago
Solved

Convert a range of numbers to text string

I need to convert a range of numbers to text strings. I have some X coordinates that range from 0 -100 so want to be able to create a new column called Zones with the following criteria: 

 

if X is >= 78 = "Zone 1"

if X is <78 & >= 50 = "Zone 2"

if X is <50 & >= 23 = "Zone 3"

if X is <23 = "Zone 4"

 

How do I put this into a DAX script?

 

Thanks for the help

  • Hello jamieham ,

     

    So instead of X , you mention the column name that has the number and create it as a calculated column.

     

    Column = if( x <23, ""Zone 4", if(x >= 23 && x <50, "Zone 3", if(x >=50 && x<78,""Zone 2", "Zone 1")

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

    Follow me on Linkedin

1 Reply

  • Hello jamieham ,

     

    So instead of X , you mention the column name that has the number and create it as a calculated column.

     

    Column = if( x <23, ""Zone 4", if(x >= 23 && x <50, "Zone 3", if(x >=50 && x<78,""Zone 2", "Zone 1")

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

    Follow me on Linkedin