Forum Discussion
Anonymous
6 years agoNot applicable
Problem calculating retaining customers
Could anybody please explain why it doesn't work when I'm trying to identify if a new customer is retained. The logic I'm having is that if a customer have never made any purchase before current purc...
parry2k
6 years agoSuper User
Anonymous here are the measures which can get you first purchase date and the very next purchase date after first purchase and you can take it from there
First Purchase = CALCULATE ( MIN ( Orders[Date] ), ALLEXCEPT ( Orders, Orders[customer ID] ) )
Next Purchase =
VAR __firsPurchase = [First Purchase]
RETURN CALCULATE ( MIN ( Orders[Date] ), ALLEXCEPT ( ORders, Orders[customer ID] ), Dates[Date] > __firsPurchase )
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Anonymous
6 years agoNot applicable
Thank you amitchandak
Now I have
Retaining Customers =
COUNTROWS(
FILTER(
VALUES(Orders[会员ID]),
CALCULATE(
COUNTROWS(Orders),
FILTER(
ALLEXCEPT(Orders, Orders[会员ID]),
DATEDIFF([First Order Date], [Second Order Date],DAY) <= [Churn Time Value]
)
)
)
)
This gives number of retaining customers. But if a customer keep making purchases in different months, this customer will be counted as retaining customer for every month he places orders.
How am I suppose to change my function so a customer will only be counted once in his first purchase month?