Solved: Creating a Notion formula to calculate progress percentage based on completed checkbox tasks within a related database
📌 The Problem Explained
Section titled “📌 The Problem Explained”A common challenge in Notion project management is visualizing progress. You might have a Projects database and a separate Tasks database linked via a Relation. While you can see the linked tasks, Notion doesn’t automatically show you what percentage of those tasks are finished.
Without a formula, you are forced to manually count checkboxes or use a “Rollup,” which is limited in how it can be styled or integrated into more complex calculations. To create a dynamic progress bar that updates in real-time as team members check off tasks, you need a formula that counts the items in the relation, filters for completion, and performs the division.
💡 The Quick Solution
Section titled “💡 The Quick Solution”Paste the following formula into your Formula property (assuming your relation is named “Tasks” and your checkbox is named “Done”):
let( totalTasks, prop("Tasks").length(), if( totalTasks > 0, prop("Tasks").filter(current.prop("Done")).length() / totalTasks, 0 ))Note: After pasting, click the formula icon (or the property name) > Edit Property > Number format and select Percent. You can then choose the Bar or Ring display.
🛠️ Step-by-Step Breakdown
Section titled “🛠️ Step-by-Step Breakdown”| Step | UI Path / Action | Description |
|---|---|---|
| 1 | Add Property > Relation | Connect your Project database to your Task database. Name this property Tasks. |
| 2 | Tasks Database > Checkbox | Ensure your Task database has a checkbox property. Name it Done. |
| 3 | Project Database > Formula | Create a new property in the Project database and select Formula. |
| 4 | Edit Formula | Use the let function to define totalTasks for cleaner code and to avoid “division by zero” errors. |
| 5 | Filter Logic | Use .filter(current.prop("Done")) to isolate only the rows where the checkbox is checked. |
| 6 | Display Setting | Set the Number format to Percent and select Bar to visualize the progress. |
Argument Explanation
Section titled “Argument Explanation”| Function/Property | Purpose |
|---|---|
prop("Tasks") |
References the list of pages linked in the Relation property. |
.length() |
Counts the number of items in the list (total tasks). |
.filter() |
Iterates through the related tasks to find specific matches. |
current |
Refers to the specific task being evaluated during the filter process. |
if(total > 0, ... , 0) |
A safety check to ensure the formula doesn’t break if a project has zero tasks assigned. |
⚠️ Common Mistakes to Avoid
Section titled “⚠️ Common Mistakes to Avoid”- Property Name Mismatch: Notion formulas are case-sensitive. If your checkbox is named “Complete” but your formula says
prop("Done"), it will return an error. Ensure the names in the code match your property titles exactly. - Forgetting the “Percent” Format: By default, Notion formulas output a decimal (e.g., 0.5 instead of 50%). To see a progress bar, you must manually change the property’s format to Percent in the property configuration menu.
- Circular Dependencies: Ensure you aren’t trying to relate a database to itself in a way that creates an infinite loop, though this is rare for simple project/task setups.