Namaste
If you to show the sum of field in layout then there are several ways
1) Use Sum property in layout and add conditons ,. It will work if there are no grouping involved .
2) To use Sum property for Group wise Records , You have to take group footer and use sum property
Best Option is to calculate summation as per need in onaftergetrecord Trigger and check output in Report
If you feel answer is helpful , please verify the answer
Regards
Pallavi