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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

IF DAX formula for multiple conditions

Hello,

 

I have created a calculated column using the CALCULATEX function. Based on this column, i want to group the values into 4 different groups:

<0

>0 & <5

>5 & <10

>10

 

I have tried the following formula but get an error notice saying that syntax for ',' is incorrect.

 

new2 = IF('datauserprofile (2)'[Column]<0),"<0", BLANK()),
IF(AND('datauserprofile (2)'[Column]>0, 'datauserprofile (2)'[Column]<5),">0 & <5",
  IF(AND('datauserprofile (2)'[Column]>5, 'datauserprofile (2)'[Column]<10),">5 & <10",
    IF('datauserprofile (2)'[Column]>10,">10", BLANK())
 
Is there any other way to achieve the particular grouping i am looking for? I understand that I could create a conditional column in the query editor but since I am using DAX formula to come up with the column that I am basing the information on, that would not be possible.
 
Thank you.
 
Best regards,
vvmob
 
1 ACCEPTED SOLUTION
ChandeepChhabra
Impactful Individual
Impactful Individual

@Anonymous 

Try this calculated column formula

 

Capture.png

 
Profile = 
SWITCH(
    TRUE(),
    Data[Column]<0, "<0",
    Data[Column]<=5, "0 to 5",
    Data[Column]<=10, "6 to 10",
    BLANK()
) 

 

Hope this helps

 

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Try this calculated column formula

=IF('datauserprofile (2)'[Column]>10,">10",IF('datauserprofile (2)'[Column]>5,">5",IF('datauserprofile (2)'[Column]>0,">0", "<0")))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ChandeepChhabra
Impactful Individual
Impactful Individual

@Anonymous 

Try this calculated column formula

 

Capture.png

 
Profile = 
SWITCH(
    TRUE(),
    Data[Column]<0, "<0",
    Data[Column]<=5, "0 to 5",
    Data[Column]<=10, "6 to 10",
    BLANK()
) 

 

Hope this helps

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.