Customer retention rate by month over a rolling 3-month window

Of the customers who bought in the previous three months, what share bought again this month? A rolling retention rate with DATESINPERIOD and INTERSECT.

You will learn to

  • Build the customer list for the three months before the current one
  • Shift a window to end the day before the period starts
  • Divide the retained customers by the window’s customers

How it works

Monthly churn is jumpy: a customer who skips one month already counts as lost, and a year-over-year comparison reacts slowly. A **rolling retention rate** sits in between. It asks every month: of the customers who were active recently, the **three months before this one**, what share bought again **this month**?

The window must end the day before the month starts. `MIN('Date'[Date]) - 1` is that day (date arithmetic works), and `DATESINPERIOD('Date'[Date], that day, -3, MONTH)` is the three months up to it. DATESINPERIOD ignores the month on the row and returns dates from the whole calendar, which is exactly what a look-back needs.

Put the window’s buyers in a variable with CALCULATETABLE, intersect them with this month’s buyers, and divide by the window’s count. January 2024 has no earlier months, so it stays blank.

Practice it hands-on with a real data model and a live report that updates as you type.

Customers in the Last 3 Months =
VAR LastDay = MAX('Date'[Date])
RETURN CALCULATE([Customers], DATESINPERIOD('Date'[Date], LastDay, -3, MONTH))