You added a Rollup property to count related database items, but the number includes pages that are hidden by a database filter. This happens because Rollup calculates values from all related records regardless of the view’s filter settings. In this article you will learn why Rollup ignores filters and how to use a formula to count only visible pages.
Key Takeaways: Fix Rollup Count That Includes Filtered-Out Pages
- Rollup properties ignore view filters: Rollup always counts every related page, even those hidden by a database filter in the source database.
- Formula property with
filter(): Use a Notion formula to count only pages that meet a specific condition, such as a status property set to Done. - Add a helper property: Create a Checkbox or Select property on the related database to mark pages that should be counted, then reference that in the formula.
Why Rollup Ignores Database Filters
A Rollup property in Notion calculates an aggregate value—like count, sum, or average—over all pages linked through a Relation property. The Rollup does not care about the view you have set in the source database. Views are visual filters applied to the database table; they do not change the data that Rollup reads. If a page is linked to the current item, it is included in the Rollup calculation, even if that page is hidden by a filter in the source database.
For example, imagine you have a Projects database with a Relation to a Tasks database. In the Tasks database, you filter the view to show only tasks with status Done. A Rollup on the Projects database that counts all related tasks will still count tasks with status Not Started, because those tasks exist in the Tasks database and are linked. The filter only hides them from the view; it does not remove them from the relation.
To get a count that matches only the pages you consider visible or relevant, you must use a Formula property that checks a condition on each related page. The formula can use the filter() function to select only pages where a certain property meets your criteria.
Steps to Count Only Filtered Pages Using a Formula
These steps assume you already have a Relation property linking two databases and a Rollup property that currently counts all related pages. You will replace that Rollup with a Formula that counts only pages matching your filter condition.
- Identify the filter condition
Decide which property on the related database determines whether a page should be counted. Common choices are a Select property like Status or a Checkbox property like Included. For this example, use a Select property called Status with options Done and Not Done. - Add a helper Checkbox or Select property (optional)
If no existing property matches your filter condition, add a new one. For a simple toggle, add a Checkbox property named Count. Check the box on each page that should be counted. Alternatively, use a Select property with values Yes and No. - Remove the old Rollup property
In the main database, open the property menu on the Rollup column and select Delete. You will replace it with a Formula. - Add a new Formula property
Click the + icon in the database header and choose Formula. Name it Filtered Count or similar. - Enter the formula to count filtered pages
Use thefilter()function combined withlength(). The basic syntax is:length(filter(prop("Related Tasks").map(current.prop("Status")), current == "Done"))
ReplaceRelated Taskswith the name of your Relation property andStatuswith the property that contains your filter condition. ReplaceDonewith the exact value you want to count. - Test the formula
Add a few related pages and change their Status values. The Filtered Count should update to show only pages where Status equals Done. If the count shows 0, check that the property names in the formula match exactly, including capitalization.
If Notion Still Shows Wrong Counts
Formula returns 0 even when pages match the condition
The most common cause is a typo in the property name or value. Open the formula editor and verify that the Relation property name appears exactly as it does in the database header. Property names are case-sensitive. Also confirm that the value you are comparing (for example, Done) matches the option label exactly, including spaces.
Rollup counts pages from a different relation
If your database has multiple Relation properties, the Rollup or Formula might reference the wrong one. Check that the formula uses the correct Relation property name. A quick way to verify is to hover over the property name in the formula editor—Notion highlights the corresponding column in the database.
Filtered count does not update when I change a related page
Notion formulas recalculate when the current page is edited or when a related page is added or removed. If you change a property on a related page, the formula may not refresh immediately. Click the main page to force a recalculation, or add a dummy edit such as adding a space in a text property on the main page.
Rollup vs Formula Filter Count: Comparison
| Item | Rollup (Count) | Formula with filter() |
|---|---|---|
| Respects view filters | No | No (uses property condition) |
| Can count based on a condition | No | Yes |
| Requires helper property | No | Optional |
| Updates instantly on page edit | Yes | Yes (with minor delay in some cases) |
| Works with all relation types | Yes | Yes |
A Rollup count is simple but cannot exclude pages based on any condition. A Formula with filter() gives you exact control over which pages are counted. Use a Rollup when you need a total count of all related records. Use a Formula when you need a condition-based count, such as counting only completed tasks or active projects.
You now know that Notion Rollup properties do not respect database view filters and why that happens. By using a Formula property with the filter() function, you can count only pages that match a specific property value. For advanced filtering, consider adding a Checkbox or Select property to the related database to mark pages for inclusion. To further refine your counts, explore the map() function combined with filter() to check multiple conditions on each related page.