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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
925stuart
Helper I
Helper I

How do I convert number ranges into a text?

Hi, 

 

How do I convert number ranges into a text?  E.g. 

 

  • <1 = "Text1"
  • > 0 but <11 = "Text2"
  • > 10 but <21 = "Text3"
  • >20 = "Text 4"

 

Thanks!

1 ACCEPTED SOLUTION
925stuart
Helper I
Helper I

Thanks for all your suggestions!  I finally used (a Youtube solution) Switch to compare the number against a range to yield a True/False, and then assigning a Text value depending on the Binary test.   

View solution in original post

3 REPLIES 3
925stuart
Helper I
Helper I

Thanks for all your suggestions!  I finally used (a Youtube solution) Switch to compare the number against a range to yield a True/False, and then assigning a Text value depending on the Binary test.   

j_ocean
Helper V
Helper V

Use a conditional column.

wdx223_Daniel
Super User
Super User

let
    Source = #table(1,List.Zip({{0..25}})),
    Custom1 = Table.AddColumn(Source,"Custom",each {"Text1","Text2","Text3","Text4"}{List.PositionOf({1,11,21},[Column1],1,(x,y)=>y>=x)+1})
in
    Custom1

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.

Top Solution Authors
Top Kudoed Authors