DAX code
Average Customer Tenure =
AVERAGEX(
VALUES('Sales'[CustomerID]),
DATEDIFF(
CALCULATE(MIN('Sales'[OrderDate])),
CALCULATE(MAX('Sales'[OrderDate])),
DAY
)
)
Averages how many days have passed between each customer's first and most recent purchase.
Type your table and column names once. Every measure below updates.
Average Customer Tenure =
AVERAGEX(
VALUES('Sales'[CustomerID]),
DATEDIFF(
CALCULATE(MIN('Sales'[OrderDate])),
CALCULATE(MAX('Sales'[OrderDate])),
DAY
)
)
Customers with a single order return 0 tenure, which is included in the average.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Average Customer Tenure.