Repeat purchase rate: formula, DAX and time to reorder

How to calculate repeat purchase rate, the share of customers with more than one order, over all time and within a window such as 90 days of the first order, purchase frequency, time between orders, the DAX on an orders table, and why the window matters.

Short answer: repeat purchase rate = customers with two or more orders / customers with at least one order. Over all time it only goes up, so measure it within a window: the share of customers who ordered again within 90 days (or 180, matching your buying cycle) of their first order, by month of first order. Pair it with purchase frequency (orders per customer per year) and the median days to second order.

For shops, the second order is the hardest and most valuable one: customers who buy twice are far more likely to keep buying. This KPI shows whether first-time buyers come back.

How is it calculated?

First order monthNew customersOrdered again within 90 days90-day repeat rate
May1,20026422.0%
Jun1,15027624.0%
Jul1,30033826.0%
Customers by first order month, 90-day repeat
0501001502002501400-1521016-3016031-4511046-6012061-9015091-180110over 180
Days from first to second order (customers)

Most second orders here come within 60 days, so 90 days is a fair window; a seasonal product would need a year.

What is the DAX?

Add the first and second order dates per customer as calculated columns on a Customer table (or in Power Query):

-- calculated columns on Customer
First Order Date = CALCULATE ( MIN ( Orders[Order Date] ) )

Second Order Date =
VAR F = Customer[First Order Date]
RETURN CALCULATE ( MIN ( Orders[Order Date] ), Orders[Order Date] > F )

Days to Second Order =
IF ( NOT ISBLANK ( Customer[Second Order Date] ), Customer[Second Order Date] - Customer[First Order Date] )

CALCULATE in a calculated column turns the customer row into a filter (context transition), so each row sees only its own orders. Then the measures, with the Date table related to Customer[First Order Date] (an inactive relationship, or a separate date table for cohorts):

New Customers = COUNTROWS ( Customer )

Repeat within 90d =
CALCULATE ( COUNTROWS ( Customer ), Customer[Days to Second Order] <= 90 )

Repeat Rate 90d = DIVIDE ( [Repeat within 90d], [New Customers] )

Median Days to Second Order = MEDIAN ( Customer[Days to Second Order] )

-- all-time version
Repeat Customers = CALCULATE ( COUNTROWS ( Customer ), NOT ISBLANK ( Customer[Second Order Date] ) )
Repeat Rate All Time = DIVIDE ( [Repeat Customers], CALCULATE ( COUNTROWS ( Customer ), NOT ISBLANK ( Customer[First Order Date] ) ) )

Purchase Frequency = DIVIDE ( DISTINCTCOUNT ( Orders[Order ID] ), DISTINCTCOUNT ( Orders[Customer ID] ) )

Leave out the newest cohorts until 90 days have passed, or their rate looks low only because time has not run out.

What raises it?

  • A good first experience: delivery on time, clear returns.
  • A follow-up email timed to the usual reorder gap (the chart above).
  • Consumables: subscriptions or reminders.
  • A reason to come back: a voucher for the second order, loyalty points.

Measure each change by the first-order cohort, like cohort retention.

What goes wrong?

  • All-time rate only. It rises with time and hides recent changes.
  • Cohorts too young. Customers from last week have had no chance to reorder.
  • Guest checkouts. Without a customer ID, repeat buyers look new; match by email.
  • Same-day split orders. Two orders in one session are not a repeat; require a gap of a day or more.

Where can you check this?

Where do you start?

Add first and second order dates to your customer table and show the 90-day repeat rate by first-order month. New and returning customers splits revenue the same way.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.