Forum Discussion
Anonymous
4 years agoNot applicable
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 ran...
- 4 years ago
Anonymous 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" ) - Anonymous4 years ago
Hi Anonymous ,
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"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.
Greg_Deckler
4 years agoCommunity Champion
Anonymous 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"
)