How are you filtering the portal?
Normally I'd think you'd have a layout based on invoiced, and a portal based on a related invoice_items; no filters necessary. And then you can sum using a summary field. But maybe your needs are different.
Check if this (http://dl.dropbox.com/u/582612/TestInvoice.fp7) example to see if it helps you.
If not, try to explain yourself more fully.
One way to get a correct total from a filtered portal:
- Define a summary field in the portal's table that totals the correct field.
- Place a second, one row portal (borders can be invisible) at the bottom of your first portal and place this summary field inside the portal.
- Give this new portal the same filter expression as the first.