Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

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)      
         
YearMonthInitial1M2M3M4M5M6M
201571,648822734690640610596
201581,498776711656626610 
201591,515787657643620  
2015101,498721659638   
2015111,377717682    
2015121,398741     
201611,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.

 

Can someone please help me with the DAX functions and the method to proceed further.

 

Thanks,

Kanchan

9 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Greg_Deckler  Thank you for sharing the link.

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

    • MAAbdullah_47's avatar
      MAAbdullah_47
      Helper V

      Hi Greg_Deckler  
      I'm Interested in (Cohort analysis post) but I didn't understand your answer completely, where can I found the complete article (post) answer regarding cohort analysis?

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    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
  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    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.

     

    Can someone please help me with the DAX functions and the method to proceed further.


    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's avatar
      Anonymous
      Not applicable

      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

  • Hi Anonymous 

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

    sue