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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cottrera
Post Prodigy
Post Prodigy

DAX Multiple If

Hi 

I have a visual table that displays the following columns 'week start' and 'w number' (Note the w number is a measure)

 

I require a multiple IF to show text based on the 'w number' results in my visual table.

 

I have tried this DAX 

W-Result = IF(AND([W number]>=0,[W number]<=1),"X1"&IF(AND([W number]>1,[W number]<=2),"X2"&IF(AND([W number]>2,[W number]<=20),"X3")))
 
Here are the results which are not what I expected (Below are my expected results)
Week startW numberW-Result
21/09/20201.4 
28/09/20201.2 
05/10/20201.6 
12/10/20201.2 
26/10/20201.6 
02/11/20201.1 
09/11/20201.8 
16/11/20201.7 
19/10/20200.8X1
 
This is what I am expecting
Week startW numberW-Result
21/09/20201.4X2
28/09/20201.2X2
05/10/20201.6X2
12/10/20203.1X3
26/10/20201.6X2
02/11/20201.1X2
09/11/20201.8X2
16/11/20201.7X2
19/10/20200.8X1

 

Thank you

 

Richard

1 ACCEPTED SOLUTION
manikumar34
Solution Sage
Solution Sage

@cottrera ,

You are using AND that resukts whn satatement is true

Try the bottom.

Resultado W-Result á IF(AND([W number]>-0,[W number]<-1),"X1",IF(AND([W number]>1,[W number]<-2),"X2",IF(AND([W number]>2,[W number]<-20),"X3")))

Rehards,

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

3 REPLIES 3
cottrera
Post Prodigy
Post Prodigy

Thank you

@cottrera ,

Awesome, you got the answer.

 

Leave a like if you find helpful.

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




manikumar34
Solution Sage
Solution Sage

@cottrera ,

You are using AND that resukts whn satatement is true

Try the bottom.

Resultado W-Result á IF(AND([W number]>-0,[W number]<-1),"X1",IF(AND([W number]>1,[W number]<-2),"X2",IF(AND([W number]>2,[W number]<-20),"X3")))

Rehards,

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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