Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I want to calculate the average return time of my customers over time.
I have a table with general data such as Cust_ID, and order_date per order.
Right now i have general calculations based on first_order and last_order, however this doesn't cover all averages, since some customers have 10+ orders.
Is there a way to calculate the average time between orders? Using the regular DATE commands (DATEDIFF, DATESBETWEEN, etc,), i run into problems since most of them only accept two dates, not more.
Thanks in advance!
Solved! Go to Solution.
@Milan_TBC , A new column
Diff =
var _max = maxx(filter(Table, [Customer] = earlier([Customer]) && [Order date] < earlier({order date]) ) , [Order Date])
return
datediff(_max, [Order date], day)
Then you can take AVg of this column
Or move this in a Meausure
AverageX(Table,
var _max = maxx(filter(Table, [Customer] = earlier([Customer]) && [Order date] < earlier({order date]) ) , [Order Date])
return
datediff(_max, [Order date], day) )
Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
@Milan_TBC , A new column
Diff =
var _max = maxx(filter(Table, [Customer] = earlier([Customer]) && [Order date] < earlier({order date]) ) , [Order Date])
return
datediff(_max, [Order date], day)
Then you can take AVg of this column
Or move this in a Meausure
AverageX(Table,
var _max = maxx(filter(Table, [Customer] = earlier([Customer]) && [Order date] < earlier({order date]) ) , [Order Date])
return
datediff(_max, [Order date], day) )
Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 9 | |
| 8 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 23 | |
| 15 | |
| 15 | |
| 14 | |
| 9 |