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
karkar
Helper III
Helper III

MULTIPLE IF CONDITIONS

Hello,

 

Can anyone help me with the DAX for this?

 

 

1 ACCEPTED SOLUTION

Hi @karkar,

In excel, we calculate based on cell, while in Power BI, we calculate the value based on column. The difference for DAX and excel function is: there are only logical conditions in AND in DAX. In excel, you can more than two conditions in AND like: AND(logical1, [logical2], ...). I create it in excel and get expected result.

In excel, AND(A8= "Not Hispanic or Latino Origin",B8<>"Unavailable",B8<>"Declined") is equals to AND(A8= "Not Hispanic or Latino Origin",AND(B8<>"Unavailable",B8<>"Declined"))

The results of using AND and OR in the red part are different. I confused it before, so I edit my last reply. Thanks for understanding. Now I test it in BI and Excel.  

=IF(OR(A8="Hispanic or Latino Origin Unknown",A8="Declined - patient is unwilling to respond"),"Unknown",IF(A8="Hispanic or Latino Origin", "Hispanic",IF(AND(A8= "Not Hispanic or Latino Origin",B8<>"Unavailable",B8<>"Declined"),B8,"Unknown")))

=IF(OR(A8="Hispanic or Latino Origin Unknown",A8="Declined - patient is unwilling to respond"),"Unknown",IF(A8="Hispanic or Latino Origin", "Hispanic",IF(AND(A8= "Not Hispanic or Latino Origin",OR(B8<>"Unavailable",B8<>"Declined")),B8,"Unknown")))



Using ANDUsing ANDUsing ORUsing OR
Best Regards,
Angelia

View solution in original post

10 REPLIES 10

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.