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 September 15. Request your voucher.

Reply
LarkMae
Regular Visitor

Replace continuous numerical data with categorical text data

Hi, I am having difficulty finding a dax equation that can help me categorize numerical data.

 

I have a column in powerbi called satisfaction, inside a table called mobile. Satisfaction scores range from 0 -100. 

 

I would like:

0 - 29 -> Very dissatisfied

30 - 49 -> Dissatisfied

50 - 69 -> Neutral

70 - 79 -> Satisfied

80 - 100 -> Very Satisfied

 

I know i need to make a new column and use a DAX equation. But every equation I have tried has not worked.

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@LarkMae Try:

 

I cant get no =
  VAR __Satisfaction = 'Mobile'[Satisfaction]
RETURN
  SWITCH(TRUE(),
    __Satisfaction <= 29, "Very dissatisfied",
    __Satisfaction >= 30 && __Satisfaction <= 49, "Dissatisfied",
    __Satisfaction >= 50 && __Satisfaction <= 69, "Neutral",
    __Satisfaction >= 70 && __Satisfaction <= 79, "Satisfied",
    "Very Satisfied"
  )

 



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

Anonymous
Not applicable

Hi @LarkMae ,

 

Please follow @Greg_Deckler 's suggestion which use DAX.

 

Or you could go to Power Query Editor-->Add Column-->Custom Column, then paste the following M syntax:

if [Satisfaction]>=0 and [Satisfaction]<=29 then "Very dissatisfied" else if [Satisfaction]>=30 and [Satisfaction]<=49 then "Dissatisfied" else if [Satisfaction]>=50 and [Satisfaction]<=69 then "Neutral" else if [Satisfaction]>=70 and [Satisfaction]<=79 then "Satisfied" else "Very Satisfied"

 

Eyelyn9_0-1644895854235.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @LarkMae ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it.😀

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @LarkMae ,

 

Please follow @Greg_Deckler 's suggestion which use DAX.

 

Or you could go to Power Query Editor-->Add Column-->Custom Column, then paste the following M syntax:

if [Satisfaction]>=0 and [Satisfaction]<=29 then "Very dissatisfied" else if [Satisfaction]>=30 and [Satisfaction]<=49 then "Dissatisfied" else if [Satisfaction]>=50 and [Satisfaction]<=69 then "Neutral" else if [Satisfaction]>=70 and [Satisfaction]<=79 then "Satisfied" else "Very Satisfied"

 

Eyelyn9_0-1644895854235.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is perfect!!  

 

Thank you so much!!

AlexisOlson
Super User
Super User

You can also control this via a configuration table rather than hardcoding all the values in a DAX expression.

 

See this article on the static segmentation:
https://www.daxpatterns.com/static-segmentation/

Greg_Deckler
Community Champion
Community Champion

@LarkMae Try:

 

I cant get no =
  VAR __Satisfaction = 'Mobile'[Satisfaction]
RETURN
  SWITCH(TRUE(),
    __Satisfaction <= 29, "Very dissatisfied",
    __Satisfaction >= 30 && __Satisfaction <= 49, "Dissatisfied",
    __Satisfaction >= 50 && __Satisfaction <= 69, "Neutral",
    __Satisfaction >= 70 && __Satisfaction <= 79, "Satisfied",
    "Very Satisfied"
  )

 



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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors