Average days between purchases per customer
Measure how often each customer buys: the days from first to last purchase divided by the number of gaps between purchase days.
You will learn to
- Find the first and last purchase in the period with MINX and MAXX
- Count purchase days rather than order lines
- Divide a span of days by the number of gaps between purchases
How it works
**Purchase frequency** answers “how often does this customer come back?” A customer who buys every 15 days needs a different reminder schedule from one who buys every two months.
Take the span from the first to the last purchase in the period, then divide by the number of **gaps** between purchases. Five purchase days have four gaps between them, so divide by the count minus one.
Count **days**, not order lines: one visit can produce several order lines (one per product), and those don’t mean the customer came back. `DISTINCTCOUNT(Sales[DateKey])` counts the different days. A customer who bought on only one day has no gap at all, and `DIVIDE` returns blank when it would divide by zero.
Practice it hands-on with a real data model and a live report that updates as you type.
Days Active per Product =
DIVIDE(DATEDIFF(MINX(Sales, RELATED('Date'[Date])), MAXX(Sales, RELATED('Date'[Date])), DAY), DISTINCTCOUNT(Sales[ProductKey]))