Summarizing data in portals
You can summarize data that's in a related field displayed in a portal. The portal can contain records from a related table or from the same table, using a relationship defined from and to the current table (a self-join).
To summarize data in portals:
1.
See Defining calculation fields for more information.
2.
For example, if you are in the Invoices table and want to define a calculation to total the related values in the Price field of the LineItems table, use the formula Sum(LineItems::Price)
3.
See Placing and removing fields on a layout for more information.
Related topics 
Creating portals to hold related records