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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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