I'll expand a little bit on my previous two colleagues excellent tips, only because I have this happen a lot!
The 'out of balance' is that the Distribution TYPE codes do not match up to the amounts on the face of the PO Invoice. So, if you have an amount in the Trade Discount field, all of your distributions with the TYPE TRADE need to add up to the value of the Trade Discount. You can have as many lines per distribution type as necessary, but it has to balance to the Purchasing Invoice itself or you will receive the error you spoke of. Here how the distribution types match up to the Invoice:
TRADE = Trade Discount
FREIGHT = Freight
MISC = Miscellaneous
TAX = Tax
PAY = Total
ACCRUED = Subtotal
PURCH = the difference between the receipt & invoice price of the item
Please let us know if this was not the source of your problem.
Kind regards,
Leslie