How to Use Notion Database Group by Date With Custom Bucket Width
🔍 WiseChecker

How to Use Notion Database Group by Date With Custom Bucket Width

Notion database views let you group items by a date property, but the default group options are fixed to day, week, month, quarter, or year. You may need a custom bucket width, such as grouping by 2-week sprints, 3-month quarters, or 10-day intervals. Notion does not offer a built-in slider or input to set arbitrary bucket sizes. This article explains how to achieve custom date grouping using a formula property combined with a rollup or a second date property.

Key Takeaways: Group Dates With Custom Buckets in Notion

  • Formula property with dateFloor or dateAdd: Creates a custom date bucket label from an existing date property.
  • Group by the formula property: Replaces the default date grouping with your custom bucket width.
  • Sort by the original date: Maintains correct chronological order inside each bucket group.

ADVERTISEMENT

How Notion Groups Dates and Why Custom Buckets Need a Workaround

Notion database views provide a Group option for date properties. The available bucket widths are day, week, month, quarter, and year. These are hard-coded and cannot be changed in the view settings. When you need a bucket width like 5 days, 2 weeks, or 3 months, you must create a separate property that computes the bucket label. The formula property can generate a text or date value that represents the start of your custom bucket. You then group the view by that formula property instead of the original date property. This workaround works in table, board, timeline, and calendar views, but the bucket labels appear as text strings, not as native date headers.

Prerequisites for Custom Date Buckets

Your database must have a date property to base the bucket on. You need edit permissions on the database to add a formula property. The formula uses functions such as dateFloor, dateAdd, dateSubtract, formatDate, and if. Understanding basic Notion formula syntax is required. The bucket label will be a text string, so sorting by the original date property is necessary to keep items in order within each group.

Steps to Create a Custom Date Bucket Width

Follow these steps to add a formula property that groups dates into custom intervals. The example groups dates into 2-week buckets, but you can adjust the arithmetic for any interval.

  1. Add a formula property to the database
    Open your database view. Click the + icon in the last column header. Select Formula from the property type list. Name the property something like “2-Week Bucket”.
  2. Write the formula for the custom bucket
    In the formula editor, enter an expression that calculates the start date of the bucket. For a 2-week bucket starting on Monday, use:
    dateFloor(prop("Date"), "weeks", 2)
    This rounds each date down to the nearest Monday that falls on a multiple of 2 weeks from an epoch. For a 10-day bucket, use:
    dateFloor(prop("Date"), "days", 10)
    Click Done to save the formula.
  3. Format the bucket label as text
    If you want the bucket to display as a readable range, wrap the formula with formatDate. For a 2-week bucket showing the start and end dates:
    formatDate(dateFloor(prop("Date"), "weeks", 2), "MMM D, YYYY") + " - " + formatDate(dateAdd(dateFloor(prop("Date"), "weeks", 2), 13, "days"), "MMM D, YYYY")
    This creates a label like “Mar 4, 2024 – Mar 17, 2024”.
  4. Group the view by the formula property
    Click the view menu at the top left of the database. Select Group. In the Group by dropdown, choose your formula property (e.g., “2-Week Bucket”). The database now groups items by your custom bucket width.
  5. Sort items within each group by the original date
    To keep items in chronological order inside each bucket, add a sort rule. Click the view menu, then Sort. Add a sort on your original date property in ascending order. This ensures that within the “Mar 4 – Mar 17” bucket, items appear from earliest to latest.
  6. Adjust the view layout if needed
    In a board view, each bucket becomes a column. In a timeline or calendar view, the bucket property replaces the date grouping. You may need to hide the original date property from the view to reduce clutter. Right-click the original date column header and select Hide.

Alternative Method: Using a Text Formula With Manual Bucket Mapping

If the dateFloor function does not produce the exact interval you need, you can write a formula that maps dates to bucket names manually. This approach is more flexible but requires more formula logic.

  1. Create a formula that calculates days since a fixed date
    Add a formula property named “Days Since Epoch” with:
    dateBetween(prop("Date"), fromTimestamp(0), "days")
  2. Divide by your bucket width and floor
    Add another formula property named “Bucket Number” with:
    floor(prop("Days Since Epoch") / 15)
    Replace 15 with your desired bucket width in days.
  3. Convert the bucket number back to a readable label
    Add a final formula property named “Custom Bucket” with:
    "Bucket " + format(prop("Bucket Number") + 1)
    Or compute a date range using fromTimestamp and formatDate. Group the view by this final property.

ADVERTISEMENT

Limitations and Things to Avoid With Custom Date Buckets

Custom date buckets created with formulas have several constraints you must account for.

Bucket Labels Are Text, Not Native Date Headers

Notion treats the formula output as plain text. The group headers will not collapse or expand with the native date picker. You cannot click a bucket header to jump to a calendar view. The labels also do not show the number of items in the bucket automatically.

Formula Properties Cannot Be Used in Calendar View as Date Sources

In a calendar view, the date source must be a date property, not a formula. You cannot use the custom bucket formula as the primary date for the calendar. The workaround is to use the original date property for the calendar and group by the formula in a separate board or table view.

Sort Order May Break Across Bucket Boundaries

If your formula produces bucket labels that are not lexicographically sortable (e.g., “Bucket 10” comes before “Bucket 2”), the groups will appear out of order. Always format bucket labels so they sort correctly. Use zero-padded numbers or ISO date strings. For example, use format(prop("Bucket Number") + 1, "00") to get “01”, “02”, etc.

Rollups and Relations Do Not Work With Formula-Based Groups

If you group a linked database view by a formula property, the rollup aggregation (count, sum, average) may not update correctly. Test the view after grouping to ensure rollup values reflect the correct items.

Changing the Bucket Width Requires Editing the Formula

You cannot adjust the bucket width from the view settings. To change from 2-week buckets to 3-week buckets, you must edit the formula property. This is not intuitive for non-technical users. Document the formula logic so other editors understand how to modify it.

Notion Default Date Grouping vs Custom Formula Buckets

Item Default Date Grouping Custom Formula Bucket
Bucket width options Day, week, month, quarter, year Any interval defined in the formula (e.g., 5 days, 2 weeks, 3 months)
Group header type Native date header with collapse/expand Plain text string
Calendar view compatibility Yes, as primary date source No, cannot be used as calendar date source
Sort order within groups Automatic by date Requires manual sort on original date property
Ease of adjustment Change in view settings Must edit formula property
Works with rollups Yes May produce incorrect rollup values

Custom formula buckets give you full control over the grouping interval but sacrifice native date behavior and ease of adjustment. Use default grouping when the built-in intervals meet your needs. Use a formula bucket when you need a non-standard interval such as a 2-week sprint, a 10-day billing cycle, or a 3-month rolling quarter.

After setting up your custom bucket formula, test the view with a few items to confirm the groups contain the correct dates. Adjust the formula if dates fall into the wrong bucket. Once the formula works, you can duplicate the database template to reuse the same bucket logic in other projects. For advanced cases, combine the bucket formula with a rollup to show counts or sums per bucket in a linked database.

ADVERTISEMENT