For the subtotal for each category, the percentage not must be the sum of the percentages calculated for each product row in the category group.

Why do you think the subtotal will be the sum of the percentages?

Keep in mind that each cell is evaluated in its own context. It doesn't look at other cells in the PT. Therefore the subtotal cell will follow the same formula (i.e. Invoices1/(Invoices1 + Invoices2) ) as the rest of the cells, it will just use the aggregated
values of Invoices1 & Invoices2.