You have a Notion database with a formula column. When you sort the database by that formula column, the filter results in a different view of the same database change unexpectedly. This happens because Notion calculates formula values in a specific order relative to filtering. This article explains the technical cause of this behavior and shows you how to prevent formula sorts from breaking your view filters.
Key Takeaways: Formula Sort Interfering with Filtered Views
- Formula evaluation order: Notion evaluates formulas after filtering, so a sort on a formula column can reorder rows and make filtered results appear inconsistent.
- View-level sort vs database-level sort: Adding a sort on a formula column inside a filtered view can alter which rows pass the filter due to formula dependency on other columns.
- Use a Rollup column instead: Replace the formula column with a Rollup column when the sort must not affect filter results, because Rollup values are static until the source property changes.
Why Sorting by a Formula Column Changes Filter Results
Notion processes database views in a specific sequence. First, it applies the filter conditions to the rows in the database. Then it calculates any formula values for the rows that passed the filter. Finally, it sorts the filtered and calculated rows based on the sort rules you defined. This order matters because a formula can reference other properties, including rollups, relations, or other formulas. When you sort by a formula column, Notion must calculate the formula for every row that passes the filter. If the formula depends on a property that is itself affected by the filter — for example, a rollup from a linked database that also has filters — the result can change the set of rows that match the filter.
The root cause is that Notion does not cache formula values before filtering. Each time you apply a sort on a formula column, Notion recalculates the formula for all rows in the view. If the formula uses a function like prop("Status") and the view has a filter on the same property, the sort can cause the formula to return different values for the same row depending on the sort direction. This creates the illusion that the filter is broken, when in reality the formula is being evaluated after the filter has already narrowed the row set.
Formula Dependency on Filtered Properties
Consider a database with a Status property that can be “Active” or “Inactive.” You create a formula that returns “Priority” if Status equals “Active” and “Low” if Status equals “Inactive.” You then filter the view to show only rows where Status is “Active.” If you sort by the formula column, Notion first filters to Active rows, then calculates the formula for those rows, then sorts. The formula always returns “Priority” for these rows, so the sort has no effect. But if the formula references a related database or a rollup that itself has a filter, the sort can trigger a recalculation that changes the rollup value, which then changes the formula result, which can cause the row to no longer match the original filter.
Steps to Prevent Formula Sort from Breaking Filters
- Identify the formula dependency chain
Open the formula column and note every property it references. If any referenced property is a Rollup, Relation, or another formula, trace the chain until you reach a base property. Write down the full list of properties. - Check the view filter properties
Go to the view that shows incorrect results. Click the filter button and list all properties used in the filter. Compare this list with the dependency list from step 1. If any property appears in both lists, that property is the source of the conflict. - Remove the formula column sort from the conflicting view
In the problematic view, click the sort button (arrow icon) and delete the sort rule that uses the formula column. This stops Notion from recalculating the formula after the filter is applied. - Create a separate property for sorting
Add a new Select or Number property to the database. Manually set values in this property that match the sort order you need. Use this new property for sorting instead of the formula column. Because this property is not a formula, Notion does not recalculate it during view rendering. - Use a Rollup column instead of a formula
If the formula is pulling data from a related database, replace it with a Rollup column. Rollup values are computed when the source row changes, not during view rendering. This makes them stable for sorting inside filtered views. - Test the view after each change
After making any change, refresh the view by navigating away and back. Check that the filter now returns the expected rows regardless of the sort order.
If Notion Still Shows Wrong Filter Results After the Fix
Formula column still appears in the sort list
Even after you delete the sort rule, the formula column may reappear in the sort list if the database has a default sort set at the database level. Open the database properties panel, click on the database name, and select “Properties.” Look for a default sort rule. Remove any sort rule that references a formula column. Database-level sorts override view-level sorts and can reintroduce the problem.
Rollup column changes value when sort is applied
If you switched to a Rollup column but still see filter changes, the Rollup itself may depend on a formula in the source database. Open the source database and check if the property being rolled up is a formula. If it is, replace that formula with a static property in the source database. The Rollup will then return a fixed value that does not change during view rendering.
Filter uses a formula that references the sorted column
If your filter itself is a formula — for example, a formula that returns true or false — and that formula references the column you are sorting by, the filter and sort will interfere. Remove the filter formula and use a simple property filter instead. For example, replace a filter formula like prop("Priority") == "High" with a direct filter on the Priority property set to “High.”
Notion View Filter vs Formula Sort: Behavior Comparison
| Item | Filter applied first, then sort on formula | Sort on formula applied without filter |
|---|---|---|
| Row selection | Rows are selected by filter before formula is calculated | All rows are included and formula is calculated for every row |
| Formula calculation timing | Calculated after filter, only for filtered rows | Calculated for all rows before any ordering |
| Effect on filter results | Sort can change which rows appear if formula references filtered property | No filter to affect |
| Recommended workaround | Use a static property for sorting or replace formula with Rollup | No workaround needed |
You now understand why sorting by a formula column can alter filter results in Notion. The key fix is to remove the formula column from the sort rule in the filtered view and use a static property or a Rollup column for sorting instead. For advanced control, consider creating a dedicated Sort Order property with manually assigned numbers and sorting by that property. This approach gives you predictable, filter-independent sorting behavior across all views.