09-26-2022 19:43 PM
Period Of Stay – Cohort Analysis provide visibility on how many customers were retained after their first date of purchase.
Cohort Analysis is studying the behavioral analysis of customers.
Assume there are 100 new customers (consumers who made the first purchase in the store) in Jan 2020. Out of these 100, how many customers came back in the second month (Feb 2020). Then how many returned in the third month (March -2020) and so on for every month in 2020.
First Sales = minx(FILTER(Sales,[Customer Id] =EARLIER([Customer Id])),[Sales Date]) Customer Age = DATEDIFF([First Sales],[Sales Date],MONTH)+1
Customer Age Bucket = ADDCOLUMNS(GENERATESERIES(1,max(Sales[Customer Age])+1) ,"Age in Month" , "Month " &[Value])
Customers = DISTINCTCOUNT(Sales[Customer Id]) Retain % = CALCULATE(divide(DISTINCTCOUNT(Sales[Customer Id]),CALCULATE(DISTINCTCOUNT(Sales[Customer Id]),ALLSELECTED('Customer Age Bucket') , 'Customer Age Bucket'[Age] =1)) , 'Customer Age Bucket'[Age] >1)
Thanks. I am stuck at the Measures steps - 3rd step in the response above. How do you keep the age bucket in the sales table?
@ewu ,There is column rename value -> age (is that creating confusion)
In that case you create a new column in sales
Customer Age Bucket = "Month " & format([Customer Age],"00")
You can also use measures like
Retain % = divide(DISTINCTCOUNT(Sales[Customer Id]),CALCULATE(DISTINCTCOUNT(Sales[Customer Id]),[Customer Age] =1))
After the First Sales and Customer Age Columns are done, and then Customer Age Bucket Tables is created, then Measures steps for Retain %, I guess, are created in the original data table? How is it linked to the Customer Age Bucket table? @amitchandak @Annie_Do_1413
@ewu , Customer Age has been calculated using the first sales date and sales date. That has been joined with the dimension table. If needed we can keep the Age bucket in the sales table.
Power BI Cohort Analysis, Customer Retention %- https://youtu.be/qY1SDF1cwsg
Great! Thanks for your sharing