title: pivot syntactically correct but logically incorrect
body: <p>My code is creating pivot syntactically correct but logically it is incorrect. 
  Here is my excel sheet. What it is showing that highlighted in yellow in a sales order which has item # 10 ordered in quantity of 2500. Since it was shipped in broken shipments(highlighted in green), it has 4 line items(highlighted in yellow).
  <a href="https://i.stack.imgur.com/g8sES.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g8sES.jpg" alt="enter image description here"></a></p>
  
  <p>My code to create pivot.</p>
  
  <pre><code>pivot = pd.pivot_table(df2,
                             index=['Customer_Name'],
                             values=[
                                 'Billed_Net_Value',
                                 'Sales_Order_Net_Value',
                                 'Open_Amount'],
                             aggfunc=np.sum,
                             margins=True)
  </code></pre>
  
  <h2>End result:</h2>
  
  <p><a href="https://i.stack.imgur.com/pVx6O.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pVx6O.jpg" alt="enter image description here"></a></p>
  
  <p>See that end result highlight in yellow has $2500 * 4 and $9500 * 4. It should really be counted once. Any tips on how to do that?</p>
  
  <h2>Expected numbers</h2>
  
  <p>It should be 75475 - (2500 * 3) - (9500 * 3) = 39475. If instead of counting 2500 * 3 times and 9500 * 3 times we only count them once, the numbers will be correct.</p>