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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
TriciaECIU
New Member

Creating a new text colum based on a number range in another column

Hi all, new Powerbi user here,

 

I have been trying to find this via the forums, and many a re similar, but different enough to make the solutions not viable for me (I think).

 

I want to create a new column that gives a text output based on a number range in another column.

 

So, where column 1's value is between:

  • 0 and 9, column 2 should show 'very low' in the corresponding row
  • 10 and 30,  column 2 should show 'low' in the corresponding row
  • 31- 50, column 2 should show 'medium-low' in the corresponding row
  • 51-60, column 2 should show 'Medium' in the corresponding row
  • 61-70, column 2 should show 'Medium-high' in the corresponding row
  • 71-90, column 2 should show 'High' in the corresponding row
  • 91-100, column 2 should show 'Very low' in the corresponding row

I am thinking it is a ValueLookUp statement? But not sure of the syntax.

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@TriciaECIU

It's PowerQuery so it is just nested if then else statements:

if [Column] >= 0 and [Column] <= 0 then "Very Low" else if [Column] >= 10 and [Column] <= 30 then "Low" else ...

DAX would be cleaner. SWITHC(TRUE(), ...) is your friend here:

Column = 
  SWITCH(TRUE(),
    [Column] >= 0 && [Column] <= 9, "Very Low",
    [Column] >= 10 && [Column] <= 30, "Low",
    [Column] >= 31 && [Column] <= 50, "Medium-Low",
    [Column] >= 51 && [Column] <= 60, "Medium",
    [Column] >= 61 && [Column] <= 70, "Medium-High",
    [Column] >= 71 && [Column] <= 90, "High",
    "Very High"
  )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
TriciaECIU
New Member

@Greg_Deckler Thank you!

Greg_Deckler
Community Champion
Community Champion

@TriciaECIU

It's PowerQuery so it is just nested if then else statements:

if [Column] >= 0 and [Column] <= 0 then "Very Low" else if [Column] >= 10 and [Column] <= 30 then "Low" else ...

DAX would be cleaner. SWITHC(TRUE(), ...) is your friend here:

Column = 
  SWITCH(TRUE(),
    [Column] >= 0 && [Column] <= 9, "Very Low",
    [Column] >= 10 && [Column] <= 30, "Low",
    [Column] >= 31 && [Column] <= 50, "Medium-Low",
    [Column] >= 51 && [Column] <= 60, "Medium",
    [Column] >= 61 && [Column] <= 70, "Medium-High",
    [Column] >= 71 && [Column] <= 90, "High",
    "Very High"
  )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors