Skip to content

Solved: How to calculate project completion percentage from a related tasks database using the map and filter functions in Notion Formulas 2.0

In a standard project management setup, you typically have two databases: Projects and Tasks. These are linked via a Relation property.

The challenge arises when you want to see a real-time “Progress Bar” on the Project level that reflects the percentage of completed tasks. Before Formulas 2.0, users had to rely on complex Rollups or multiple helper properties. With the introduction of map() and filter(), you can now perform this calculation directly within a single formula, making your workspace faster and more reliable.

Copy and paste the following formula into your Formula property (ensure your relation property is named “Tasks” and your status property is named “Status”):

let(
totalTasks,
Tasks.length(),
if(
totalTasks > 0,
Tasks.filter(current.Status == "Done").length() / totalTasks,
0
)
)

To display this as a progress bar:

  1. Click the Formula property name.
  2. Select Edit Property.
  3. Change Number format to Percent.
  4. Change Show as to Bar or Ring.

Follow these steps to set up the databases and the advanced Formula 2.0 logic.

Step Action Explanation
1 Create a Relation In your Projects database, add a new property: Relation > Select Tasks database. Enable “Show on Tasks.”
2 Check Property Names Ensure the Tasks database has a Status property. Note if the completion state is “Done” or “Complete.”
3 Add Formula Property In Projects, click + > Formula. Name it “Progress.”
4 Open Formula Editor Click inside the new “Progress” field and select Edit.
5 Apply filter() Use Tasks.filter(current.Status == "Done") to create a list containing only finished tasks.
6 Apply .length() Add .length() to both the filtered list and the total Tasks list to convert the lists into numbers.
7 Handle Zero Division Wrap the calculation in an if() statement or let() function to ensure projects with 0 tasks show 0% instead of an error.
  • Case Sensitivity: Notion formulas are case-sensitive. If your status is “Done”, but you type current.Status == "done" in the formula, the result will always be 0%. Always match the exact text of your Status options.
  • Property Type Mismatch: Ensure you are targeting the Relation property itself. If you attempt to use map or filter on a Rollup property, the syntax will differ. Formulas 2.0 is designed to work directly with the Relation property, making Rollups unnecessary for this specific calculation.
  • Empty Relations: If a project has no tasks assigned, dividing by Tasks.length() results in a “NaN” (Not a Number) error. Always use an if statement to check if the total task count is greater than zero.