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
Anonymous
Not applicable

How to work with multiple conditions in dax

Hello, 

 

does someone know how to select a value based on 3 or 4 conditions at the same time.

 

ex:

 

var1 = if(
           condition1 and condition2 and condition3 the do something

       if condition4 and condition 5 and condition6 then do something1

else something3)

 

ex: End Date=
if (isblank('var1')) && revenue > 100000 and revenue <= 500000 , value1,
if (blank(var1) && revenue >500000 , value2
else value3)

 

The second line (value2) work and the last line (value3) but the first value is never attribuated.

Regards,

 

Alain LePage

 

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Anonymous 

I have no idea what exactly do you nedd but it may look like

End Date=
if (isblank([var1]) && [revenue] > 100000 && [revenue] <= 500000 , [value1],
if( isblank([var1]) && [revenue] >500000, [value2], [value3]) )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

I found that the condition1 is the same as condition4 in your example. Is it right?

And the value3 is in the second IF(), do you mean to get it in the first IF()?

End Date=
SWITCH (
    TRUE (),
    ISBLANK ( [var1] )
        && [revenue] > 100000
        && [revenue] <= 500000, [value1],
    ISBLANK ( [var1] )
        && [revenue] > 500000, [value2],
    [value2], [value3]
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
Anonymous
Not applicable

The first condition is revenue greater than 10000 and less or equal to 50000 while the third condition is greater than 50000

az38
Community Champion
Community Champion

Hi @Anonymous 

I have no idea what exactly do you nedd but it may look like

End Date=
if (isblank([var1]) && [revenue] > 100000 && [revenue] <= 500000 , [value1],
if( isblank([var1]) && [revenue] >500000, [value2], [value3]) )

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.