Why Notion Formula Cannot Aggregate Across Two Levels of Rollup
🔍 WiseChecker

Why Notion Formula Cannot Aggregate Across Two Levels of Rollup

When working with Notion databases, you may find that a formula referencing a rollup property fails to calculate correctly when the rollup itself pulls from another rollup across multiple related databases. This limitation causes frustration because you expect the formula to sum, count, or average values from a chain of relations, but it returns an error or an unexpected result. The root cause lies in how Notion restricts formula properties from reading aggregated data that comes from another rollup. This article explains why this restriction exists, shows you how to work around it, and lists alternative methods to get the aggregate values you need.

Key Takeaways: Aggregation Limits in Notion Rollup Formulas

  • Formula property cannot read another rollup’s output: A formula that references a rollup property will only see the raw value of that rollup, not its aggregated result if that rollup itself depends on another rollup.
  • Maximum one level of rollup in a formula chain: You can roll up a property from a related database, but you cannot then roll up that rollup into a second database and use a formula to aggregate it further.
  • Use Notion’s built-in rollup aggregate functions instead: To sum, count, or average across multiple levels, apply the aggregate function directly on the final rollup property rather than trying to compute it in a formula.

ADVERTISEMENT

Why Notion Blocks Formulas From Reading Nested Rollups

Notion databases calculate properties in a specific order. Relation properties link rows between tables. Rollup properties then pull a value from a related row and can apply an aggregate function like sum, average, or count. A formula property runs last, after all rollups have been computed. When you create a formula that references a rollup property, the formula receives the rollup’s final value. However, if that rollup property itself references another rollup property from a different database, the formula cannot resolve the intermediate aggregated data. Notion’s calculation engine does not support recursive aggregation across multiple relation hops. This is by design to keep performance predictable and avoid circular dependencies. The result is that a formula trying to sum a rollup of a rollup will either show an error or return a value that is not the true aggregate.

For example, imagine three databases: Projects, Tasks, and Expenses. Projects has a relation to Tasks. Tasks has a relation to Expenses. You create a rollup in Tasks that sums all Expenses amounts for each task. That works fine. Then you create a rollup in Projects that sums the Tasks rollup to get total project expenses. That also works. But if you then create a formula in Projects that tries to multiply that rollup by a tax rate, the formula will fail to read the rollup’s aggregated number correctly. The formula sees the rollup as a raw property, but the rollup’s value is already a sum of a sum, which breaks the formula’s ability to use it in further calculations.

The Technical Constraint in Notion’s Property Engine

Notion processes properties in this order: 1) text and number properties, 2) relation properties, 3) rollup properties, 4) formula properties. A formula can read the output of a rollup only if that rollup reads directly from a non-rollup property in the related database. When a rollup reads from another rollup, the formula engine cannot access the intermediate aggregated value because that value is computed at a different stage. This is not a bug — it is a documented limitation of Notion’s architecture. The workaround is to avoid chaining rollups in formulas and instead use rollup aggregate functions directly on the final property.

Steps to Avoid the Two-Level Rollup Formula Limitation

The most reliable way to aggregate values across two levels of relation is to use rollup properties with built-in aggregate functions instead of formulas. Follow these steps to restructure your database so that you get the desired aggregate without a formula.

  1. Identify the source property you need to aggregate
    Open the database that contains the original values. For example, if you need the sum of expense amounts, make sure the Expense database has a Number property called Amount. This property must be a plain number, date, or checkbox — not a rollup or formula.
  2. Create a rollup in the first related database
    Go to the database that is directly related to the source. For instance, in the Tasks database, add a new Rollup property. Set the relation to the Expenses database. Under Property, select Amount. Under Aggregate, choose Sum. Name this rollup “Total Task Expenses.” This rollup now shows the sum of all expense amounts linked to each task.
  3. Create a second rollup in the parent database
    Go to the Projects database. Add a new Rollup property. Set the relation to the Tasks database. Under Property, select the rollup you just created — “Total Task Expenses.” Under Aggregate, choose Sum again. Name this rollup “Total Project Expenses.” This rollup now shows the sum of all task expenses for each project, which is the total project cost.
  4. Use the final rollup directly in any formula
    If you need to apply a calculation to the aggregated value, such as adding tax, create a Formula property in the Projects database. In the formula editor, reference the “Total Project Expenses” rollup property. For example, write prop("Total Project Expenses") 1.08. Because the rollup itself contains the aggregate, the formula can multiply it. This works because the formula reads the rollup’s final value, not an intermediate rollup.
  5. Test the result
    Add a few test expenses to a task, link the task to a project, and verify that the formula in the Projects database returns the correct inflated total. If the formula still shows an error, check that the rollup properties are set to the correct aggregate function and that the relation links are properly established.

ADVERTISEMENT

If Notion Still Has Issues After the Main Fix

Formula Shows “Invalid Property” Error

If your formula references a rollup property and you see an error like “Invalid property,” the most likely cause is that the rollup property you are trying to reference is itself based on another rollup. Remove the formula and instead use a rollup with an aggregate function directly on the final database. Do not try to use a formula to aggregate a rollup of a rollup.

Rollup Returns Wrong Aggregate Value

If the rollup sum or count seems incorrect, check the relation links. In the parent database, make sure each row is properly linked to the correct child rows. Also verify that the child database’s rollup is set to the correct source property and aggregate function. A common mistake is selecting a formula property as the source for a rollup, which can cause unpredictable results.

Formula Works But Returns Zero

A formula that returns zero usually means the rollup property it references is returning zero or is empty. Check the rollup property in the parent database directly. If it shows zero, trace back to the child rollup and verify that the source numbers are present and linked. If the source numbers exist but the rollup still shows zero, the relation may be broken. Re-link the rows and refresh the page.

Notion Formula vs Rollup Aggregate: Capabilities Compared

Item Formula Property Rollup Property with Aggregate
Can read a plain number property from a related database No — formula only reads properties in the same database Yes — rollup reads from a related database directly
Can apply math to a rollup’s value Yes — if the rollup is from a non-rollup source No — rollup only outputs the aggregated value, cannot modify it
Supports aggregation across two relation hops No — formula cannot read a rollup of a rollup Yes — rollup can aggregate another rollup’s output
Can combine multiple rollup values in one calculation Yes — formula can reference multiple rollup properties No — each rollup is independent
Requires manual update or refresh No — updates automatically when source changes No — updates automatically when source changes

Notion’s design intentionally separates aggregation and calculation. Use rollup properties to gather and aggregate data from related databases. Use formula properties only to perform math or logic on data that exists in the same database or on rollups that come from a single level of relation. This separation keeps your database performant and avoids calculation errors.

ADVERTISEMENT