Total numeric values from related records

Use a Formula field on a parent record to sum a numeric field from its related records.

Use SUM to add a numeric field from related records. For example, show the total estimated cost of all requests that belong to each project. Use the same currency or unit for the amounts you want to add.

Set up the total

  1. Start with tables connected by a parent relationship, such as Projects and Requests. On the child table, choose a numeric field such as Estimate. For a test, give two requests under one project estimates of 125 and 75.
  2. In Settings → Database, select the parent table. In Fields, add a Formula field named Total estimate. Select Configure in its Options cell.
  3. Type SUM in the editor and choose the suggestion for both the related table and its numeric field. A simple formula can look like SUM(@Requests.estimate). Keep the expression Mainbase inserts so it follows the intended relationship.

Compare the result with the source records

  1. In Result, find the test project and check that the total is 200. Compare it with the values on the related-record tab. Save the formula, then check the value on the parent record.
  2. If the total is unexpected, check that the expression points to the intended field and relationship. Verify which records are linked, which have a numeric amount, and which are readable for the calculation. A blank estimate contributes no amount.

Count the related records themselves

Ask Mainbase AI

Ask about any feature in Mainbase. Find a setting, get step-by-step guidance, or troubleshoot a problem.

Open the AI assistant

Copy a question to get started

  • How do I create a Kanban view?
  • How do I invite a teammate?
  • Why is a record missing from this view?