BIE removing costs of specific item codes from total job cost and revenue

I'm using the BIE- History Invoice Items to see all items shipped against a customer's PO including credits.  I then will use the total cost and price to calculate GP%.  However, in order to get an accurate margin, I need to filter total the cost of all "/XLABOR" on the job.  I would like a calculated field column of if item code is /XLABOR show extended cost.  Extended cost is a calculated field I already added.  I then will deduct that total from the cost and revenue of the job before calculating margin.

I can export the explorer results to excel and do all kinds of things.  I can also run the report twice.  Once for everything and another to filter out the specific items I need to deduct.  I can also run the Customer History Invoices View for the cost s and revenue with the History Invoice Items BIE giving me the total cost of all of the /XLABOR.  I'm just seeking the most efficient method so that others can run this quickly.  The more complex it is, the less consistent people will be and the more complaining I'll hear.

Thank you for any suggestions.