Hi Agnes
As Neil Mitchell-Goodson Said you can use this logic and you said that this is working for you also when you take product in to table.
=Sum(RunningSum([Outstanding_Amount];([Type];[Product])) ForEach([Product])>0)
Do this Apply the brake on Type and by using out line you can collapse product and you need to the footer only.
Try this,
Thanks,
G Sampath Kumar