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
damonkimble
Frequent Visitor

Power BI DAX Multiple Conditions in a single IF statement[URGENT}

Hi,

I have three variables called:

Append Sales Invoices[Amount] = Type Decimal Number

Append Sales Invoices[Header.No] = Type Text

Append Sales Invoices[Quantity] Type Decimal Number

 

I am trying to customize a column called TSIP Hours where the output is basically Append Sales Invoices[Quantity] that goes through an IF condition.

When the Append Sales Invoices[Amount] is 0 and Append Sales Invoices[Header.No] is either "20144" or "20140" then Output is the Append Sales Invoices[Quantity]. I put the formula down below. The problem is, it's populating the quantity regardless of the If condition - so if the quantity is 1 or greater, it still populates where it should only populate when Amount is 0. 

 

TSIP Hours = IF('Append Sales Invoices'[Amount] = 0 && 'Append Sales Invoices'[Header.No_] = "20144" || "20140", 'Append Sales Invoices'[Quantity])
 
 This formula only populates on the first condition when amount is 0 but doesn't meet the second condition with the &&/||
TSIP Hours = if('Append Sales Invoices'[Amount] = 0 && ('Append Sales Invoices'[Header.No_] = "20144" || "20140"), 'Append Sales Invoices'[Quantity])power bi dax.PNG
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @damonkimble , you can try the following DAX:
TSIP Hours = IF('Append Sales Invoices'[Amount] = 0 && 'Append Sales Invoices'[Header.No_] = "20144" ||
'Append Sales Invoices'[Header.No_] = "20140", 'Append Sales Invoices'[Quantity], Blank())

Did I solve your problem?

If yes, please mark my solution Accepted!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @damonkimble , you can try the following DAX:
TSIP Hours = IF('Append Sales Invoices'[Amount] = 0 && 'Append Sales Invoices'[Header.No_] = "20144" ||
'Append Sales Invoices'[Header.No_] = "20140", 'Append Sales Invoices'[Quantity], Blank())

Did I solve your problem?

If yes, please mark my solution Accepted!

Thank you @Anonymous got this working now! 

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.