Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 36 ยท Relations and Formulas

Rollups

Use the Notion rollup property to summarize related rows: count tasks, sum budgets, show percent complete and pull dates from linked pages.

A relation tells you which rows are connected. A rollup tells you something about them. It is a property that looks through a relation, picks a property from the related rows and calculates a summary: how many, what total, what percent, the earliest date.

If relations are the roads between your databases, rollups are the traffic reports.

How a rollup is set up

A rollup property has three settings:

  1. Relation: which relation property to follow (for example Tasks, inside Projects).
  2. Property: which property of the related rows to read (for example Status, Hours, Due).
  3. Calculate: how to combine the values.

For instance, in Projects: Relation = Tasks, Property = Status, Calculate = Percent per group or Percent checked if you rolled up a checkbox. The project row then shows "60%" without anyone updating it.

Rollup recipe

Relation Which links to follow.
Property Which field to read.
Calculate How to combine the values.
1 / 2

Calculation options

The list varies with the property type you roll up. Common choices include:

Calculation Result
Show original Lists the values themselves
Count all Number of related rows
Count values / Count unique values How many have a value, and how many different ones
Count empty / Count not empty Missing and present values
Percent empty / Percent not empty Shares of related rows
Sum, Average, Median, Min, Max, Range For numbers
Earliest date, Latest date, Date range For dates
Checked, Unchecked, Percent checked For checkboxes

For a Status property Notion offers Count per group and Percent per group (for example, share in "Complete").

Worked examples

Project progress. Tasks has a Status property. In Projects, rollup Tasks to Status, calculate Percent per group: Complete. Show the result as a progress bar by choosing a Number format such as bar or ring in the property settings.

Budget total. Expenses has an Amount number, each linked to a Trip. In Trips, rollup Expenses to Amount, calculate Sum, and format as currency.

Next deadline. In Projects, rollup Tasks to Due, calculate Earliest date. A rollup acts on all related rows, finished or not. For a "next open deadline", use a filter option if your Notion version offers one, or a formula over the rolled-up list.

Newer Notion versions let a rollup use a view-style filter on related rows in some situations. If your property menu does not offer it, use a formula with filter() on the rolled-up list (formulas are covered in the next lessons).

Rollups and formulas together

A rollup can feed a formula. For example, create rollup Done tasks (Count, filtered or via status) and rollup All tasks (Count all), then a formula prop("Done tasks") / prop("All tasks") shows the ratio. See Formula Basics.

Simulating a rollup

This stand-in takes the relation from the last lesson and calculates count, sum and percent-done over related rows. It shows the calculation, not Notion's interface.

JS Rollup calculations (stand-in)

Press Run (or Ctrl + Enter) to see the console output here.

No output.

JS Earliest and latest date (stand-in)

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Troubleshooting

  1. Rollup shows nothing. The relation may be empty, or the target property is hidden in the source database; check both.
  2. Wrong total. A related row might be in Trash or filtered out of the view; rollups ignore view filters unless a filter option is explicitly set.
  3. Percentages look odd. "Percent per group" depends on the Status group, not option names. Moving an option between groups changes results.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What three things do you set when creating a rollup?

    A rollup follows a relation, reads a property from related rows and applies a calculation.
  2. 2. Which calculation shows how many related rows exist?

    Count all returns the number of related rows.
  3. 3. What is needed before you can build a rollup?

    Rollups read data through a relation.
  4. 4. Why might Percent per group change when you move a status option?

    Status groups (To-do, In progress, Complete) define the percentages.

Summary

  • A rollup summarizes a property across related rows.
  • Choose the relation, the property and the calculation.
  • Common results: counts, sums, percentages, earliest and latest dates.
  • Rollups can feed formulas for custom metrics.

Next: Formula Basics