Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
damonkimble
Frequent Visitor

DAX IF condition help

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])

 

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @damonkimble 

You need to use parentheses  ( ) to encapsulate the second condition.

 

TSIP Hours = IF('Append Sales Invoices'[Amount] = 0 && ('Append Sales Invoices'[Header.No] = "20144" || "20140"), 'Append Sales Invoices'[Quantity])

 

 30.png
Best Regards,
Community Support Team _ Eason


View solution in original post

2 REPLIES 2
v-easonf-msft
Community Support
Community Support

Hi, @damonkimble 

You need to use parentheses  ( ) to encapsulate the second condition.

 

TSIP Hours = IF('Append Sales Invoices'[Amount] = 0 && ('Append Sales Invoices'[Header.No] = "20144" || "20140"), 'Append Sales Invoices'[Quantity])

 

 30.png
Best Regards,
Community Support Team _ Eason


Anonymous
Not applicable

Try ading it again in the OR condition

 

TSIP Hours = IF('Append Sales Invoices'[Amount] = 0 &&

('Append Sales Invoices'[Header.No_] = "20144" || 'Append Sales Invoices'[Header.No_] = "20140"), 'Append Sales

Invoices'[Quantity])

 

Also you can try this as a calculated column instead.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors