cancel
Showing results for
Did you mean:
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 start W number W-Result 21/09/2020 1.4 28/09/2020 1.2 05/10/2020 1.6 12/10/2020 1.2 26/10/2020 1.6 02/11/2020 1.1 09/11/2020 1.8 16/11/2020 1.7 19/10/2020 0.8 X1

This is what I am expecting
 Week start W number W-Result 21/09/2020 1.4 X2 28/09/2020 1.2 X2 05/10/2020 1.6 X2 12/10/2020 3.1 X3 26/10/2020 1.6 X2 02/11/2020 1.1 X2 09/11/2020 1.8 X2 16/11/2020 1.7 X2 19/10/2020 0.8 X1

Thank you

Richard

1 ACCEPTED SOLUTION
Super User I

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!

Proud to be a Super User!

3 REPLIES 3
Helper IV

Thank you

Super User I

Leave a like if you find helpful.

Regards,

Manikumar

If this helps, Appreciate your KUDOS!

Proud to be a Super User!

Super User I

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!

Proud to be a Super User!

Announcements

#### Happy New Year from Power BI

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