cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

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
Super User I
Super User I

@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
Helper IV
Helper IV

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!




Super User I
Super User I

@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

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors