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
rashid0146
Regular Visitor

Returning -ve values in 3rd columns with if condition

I have two columns one is SOP Type and other is Document Amount. I need a third column containing -ve Document Amount if SOP Type is Return other wise +Ve Document Amount

 

I Applied the following formula but result is +ve Document amount in Column 3.

Net sales = IF(SalesTransactions[SOP Number]="return",SalesTransactions[Sales Amount]*-1,SalesTransactions[Sales Amount]*1)

 

Please help me getting out of this.

 

Best Regards

Rashid Anwar

3 REPLIES 3
v-huizhn-msft
Employee
Employee

Hi @rashid0146,

I test it using my sample table, your DAx syntax is right, could you please share a screenshot for further analysis?

Column = IF(NewTable[Department]="Production",NewTable[Actual]*-1,NewTable[Actual]*1)


1.PNG

Thanks,
Angelia

 

v-huizhn-msft
Employee
Employee

Hi @rashid0146,

Have you resolved your issue? If you have, welcome to share your solution or mark the right reply as answer. More people will benefit from here.

Thanks,
Angelia

v-huizhn-msft
Employee
Employee

Hi @rashid0146,

Please add a parentheses around -1, and create a calculated column using the following formulas to check if it works fine.

Net sales = IF(SalesTransactions[SOP Number]="return",SalesTransactions[Sales Amount]*(-1),SalesTransactions[Sales Amount]*1)


Best Regards,
Angelia


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.