cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Cohort Analysis To Calculate How Many Distinct Customers Retained Every Month

Hi Everyone,

I am trying to do Cohort Analysis on Customers who are retained in subsequent months.Please see the below excel which needs to be created in Power BI

 Customers (Count) Year Month Initial 1M 2M 3M 4M 5M 6M 2015 7 1,648 822 734 690 640 610 596 2015 8 1,498 776 711 656 626 610 2015 9 1,515 787 657 643 620 2015 10 1,498 721 659 638 2015 11 1,377 717 682 2015 12 1,398 741 2016 1 1,467

If my distinct Customers in July 2015 are 1,648, only 822 are retained out of those 1,648  after 1M(1month) and so on and so forth.

Similarly for subsequent months distinct customers are calculated and further calulations of retention are done based on the Initial Data.

Thanks,

Kanchan

6 REPLIES 6
Super User IV

## Re: cohort analysis

Note, Notifications are not working right now, so if you update this with data, please send me a Private message.

### I have book! Learn Power BI from Packt

Proud to be a Datanaut!

Community Support Team

## Re: cohort analysis

@Anonymous ,

If my distinct Customers in July 2015 are 1,648, only 822 are retained out of those 1,648  after 1M(1month) and so on and so forth.

Similarly for subsequent months distinct customers are calculated and further calulations of retention are done based on the Initial Data.

Actually you have clarified your table structure very well. In addtion would you please tell me what's the expected value? Are you trying to calculate come percentage like increase rate or decrease rate? To be general, you may refer to quick measure about how to create measures using DAX function in power bi to achieve what you want.

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

## Re: cohort analysis

@v-yuta-msft  The table shown in my post is what my output should be. I have distinct customernames for past 6 months(Months are selected dynamically based on current month).

I checked quick measures also but could not find anything that could be used directly for this scenario. This is a quite complicated scenario.

Please let me know if you know what functions could be used.

Thanks!

Kanchan

Anonymous
Not applicable

## Re: cohort analysis

@Greg_Deckler  Thank you for sharing the link.

I will make sure I follow all these basic rules while posting any questions in future 🙂

Frequent Visitor

## Re: Cohort Analysis To Calculate How Many Distinct Customers Retained Every Month

Hi @Anonymous

How did you progress with this, am looking at doing the same?

sue

Highlighted
Frequent Visitor

## Re: Cohort Analysis To Calculate How Many Distinct Customers Retained Every Month

If you could share the sample data.
But this will be the steps you follow.

1. Calculate the OrderPeriod in yyyy-mm format for each transaction ,

YEAR(Query1[entryDate])&VALUE(FORMAT(MONTH(Query1[entryDate]),"00"))
2. Calculate the Cohort Group for that transaction
FORMAT(CALCULATE(MIN(Query1[entryDate]),
ALLEXCEPT(Query1,Query1[custId])),"yyyy-mm").

Then use summarize DAX function to get total customers

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Announcements