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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

IF Formula Help

Hi.

 

I am trying to categorise numerial responses into 3 different categories.

 

If they answered betweeb 0-1 - I want to categorise that as 0-1 Day Active

If they answered between 2-4 - I want to categorise that as 2-4 Days Active

If they answered between 5-7 - I want to categorise that as 5+ Days Active

 

See the example of my data set below, the column in bold is what I need.

NameAnswerCatergory
Mary22-4 Active
Joe55+ Active
 
I have tried the below DAX but its coming up as error:
 
Cat@REG = IF(Table1[Answer]="","",IF(Table1[Answer]>4,"5+Active",IF(Table1[Answer]>1,"2-4 Active","0-1 Active")))
1 ACCEPTED SOLUTION
negi007
Community Champion
Community Champion

@Anonymous in this case you will need to create a calculated column like below in your data

 

Ans_Cat = if ('Table'[Answer] <=1, "0-1 Active", IF(AND('Table'[Answer] >=2,'Table'[Answer] <=4), "2-4 Active", "5+ Active"))

 

negi007_0-1622813091917.png

 

let me know if it works for you. thanks




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you to you both. This really is a great community!

Fowmy
Super User
Super User

@Anonymous 

Add the column as 

Column = 
var __v = Table1[Answer] return
SWITCH( 
    TRUE(),
    __v >= 0 && __v <=1 , "0-1 Day Active",
    __v >= 2 && __v <=4 , "2-4 Days Active",
    __v >= 5, "5 Days Active"
)
    
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

negi007
Community Champion
Community Champion

@Anonymous in this case you will need to create a calculated column like below in your data

 

Ans_Cat = if ('Table'[Answer] <=1, "0-1 Active", IF(AND('Table'[Answer] >=2,'Table'[Answer] <=4), "2-4 Active", "5+ Active"))

 

negi007_0-1622813091917.png

 

let me know if it works for you. thanks




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.