Do you use the typical date model for Invoicing?
Invoices---<LineItems (also called InvoiceData)>----Products
If you use a portal to list the items on an invoice, then this is probably the set of relationships used in your system.
If so, you'd use a find (or possibly Go TO Related records from a record in the products table) to find the desired records on a layout based on LineItems (This table is named InvoiceData in recent FileMaker starter solutions). A summary field defined in LineItems will then show you the needed total or totals.
You may find this summary report tutorial--which happens to be based on just such a data model a useful source of reporting ideas: Creating Filemaker Pro summary reports--Tutorial