PostHog / PostHog/posthog

dynamic "last N calendar months" date range option (i.e. always starting on the 1st of the month, N months back), as opposed to the current rolling -Nd / -Nm options which are relative to today's exact date.

Open
#49,798 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Feature request

Is your feature request related to a problem?
When using PostHog as a reporting tool, the current relative date range options (e.g. last 90 days, last 3 months) are calculated from today's exact date. This means the first period in the range is almost always incomplete — for example, selecting "last 3 months" on March 4 starts on December 4, cutting off the first 3 days of December.

This is especially problematic in trend insights grouped by week or month, where an incomplete first period is visually indistinguishable from a full one. It silently skews the data and makes month-over-month comparisons unreliable.

Describe the solution you'd like
Add a "last N complete periods" date range option that always snaps to the start of the current period type. For example:

Last 3 complete months on March 4 → December 1 to today
Last 4 complete weeks on a Wednesday → starts on the most recent Monday 4 weeks back
Last 7 complete days → always starts at midnight
This way, every period shown in the chart contains a full set of data, making comparisons between periods meaningful and accurate.

Describe alternatives you've considered
Using a fixed explicit date range (e.g. hardcoding December 1) works, but it requires manual updates every month and doesn't scale well for shared dashboards or automated reporting.

The rolling "-90d" option is close but consistently produces an incomplete first period, with no visual indicator in the chart that the data is partial.

Additional context
This would be particularly valuable for teams using PostHog dashboards for recurring business reporting (weekly/monthly reviews), where stakeholders expect clean, complete periods without needing to manually adjust date ranges each cycle.

Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file, test, or entry point is named in the issue. Start by clarifying the period-boundary semantics, especially whether the current period is included, then locate the existing relative date-range implementation and its tests. Done should include dynamic complete-period ranges that work for days, weeks, and months without manual date updates.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, react, typescript
Domain
analytics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.