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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
MP-iCONN
Resolver I
Resolver I

Subtraction of two columns not showing the correct values

I have an issue with two columns I am trying to subtract from.

 

One column is called Required Qty and the other is called Original Blanket Qty.  


I created a measure called Unscheduled Blanket Qty:

Unscheduled Blanket Qty = CALCULATE(SUM('Sales Orders'[Original Blanket Qty])) - SUM('Sales Orders'[Required Qty])
 
As you can see from the screenshot the 2nd line does NOT appear to be subtracting correct.  I tried a bunch of different options but not sure how to get the math to be correct.
 
Any help is greatly appreciated!
 
MPiCONN_0-1631291103142.png

 

Thank you.

 

Chad

 
1 ACCEPTED SOLUTION

@MP-iCONN 

pls try this

measure = max('Table'[orignial blanket qty])-max('Table'[rquired qty])

Measure 2 = sumx('Table',[measure])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @MP-iCONN 

Your formula works well on my side, you can refer to my pbix file. If possible, please provide your pbix file so that we can find the cause of the problem .

Ailsamsft_0-1631516342001.png

Best Regards

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ryan_mayu
Super User
Super User

@MP-iCONN 

maybe you can try

SUM('Sales Orders'[Original Blanket Qty]) - SUM('Sales Orders'[Required Qty])

you can use measures to display the first two columns to check if returns the correct result and do the calculation between these two measures.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Same issue.

 

I did a SUM measure for both Blanket Qty and Required Qty and then added in my Unchscheduled Blanket Qty with the SUM('Sales Orders'[Original Blanket Qty]) - SUM('Sales Orders'[Required Qty]) measure and still the same value where it is not subtracting the 1820 from 910 correctly.

 

MPiCONN_0-1631294648473.png

 

@MP-iCONN 

pls try this

measure = max('Table'[orignial blanket qty])-max('Table'[rquired qty])

Measure 2 = sumx('Table',[measure])

1.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I tried this and the MAX seemed to work for measure1 (Unscheduled Blanket Qty) but then I did the SUMX of that Measure1 and still off.

 

Unscheduled Blanket Qty = MAX('Sales Orders'[Original Blanket Qty]) - MAX('Sales Orders'[Required Qty])
 
Unscheduled Blanket Total = SUMX('Sales Orders',[Unscheduled Blanket Qty])

 

MPiCONN_0-1631552549309.png

 

Thank you for your help so far! 

@MP-iCONN 

since i can't reproduct the issue, could you pls provide some sample data and expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.