Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AmeenVanakar
Advocate II
Advocate II

Customer Retention Cohort Analysis - Help Needed

Hi,

I have created a logic to find the number of repeat customers & I want to build a retention cohort over 24 months. However, I am unable to match retention numbers between 2 formulas that I created i.e. # Repeat Customer vs # Customer Retention. Any help will be great.

 

Here is the Repeat Customer Logic

_# Repeat Customers = COUNTROWS(FILTER(DISTINCT(Customer_Data[CUSTOMER MOBILE NO]), CALCULATE(DISTINCTCOUNT(Customer_Data[BILL NO]))>1))
 
Where:
Customer Data = CRM Extracted Data
CUSTOMER MOBILE NO = Unique Customer ID
BILL NO = Invoice (some invoices have multiple rows as the customer purchases more than 1 product i.e. more than 1 BARCODE)
 
The formula used to create the cohort
# Customer Retention =
VAR CurrentMonthAfter = SELECTEDVALUE('_Months After'[Value])
VAR CurrentFirstOrderMonth = SELECTEDVALUE(Customer_Data[_First Order Date EOM])
RETURN
CALCULATE(
    DISTINCTCOUNT(Customer_Data[CUSTOMER MOBILE NO]),
    FILTER(
        Customer_Data,
        EOMONTH(Customer_Data[BILL DATE],0) = EOMONTH(CurrentFirstOrderMonth, CurrentMonthAfter)
    )
)
 
Where:
1. _Months After = GENERATESERIES(0,24,1)
 
2. _First Order Date EOM =
VAR CurrentCustomer = Customer_Data[CUSTOMER MOBILE NO]
RETURN
CALCULATE(
    EOMONTH(MIN(Customer_Data[BILL DATE]),0),
    FILTER(
        Customer_Data,
        Customer_Data[CUSTOMER MOBILE NO]=CurrentCustomer
    )
)
 
3. BILL DATE = Customer invoice date
 
Result using _# Repeat Customers
AmeenVanakar_0-1727595772753.png

 

Cohort Using # Customer Retention

AmeenVanakar_1-1727595867258.png

 

Data Relationships

AmeenVanakar_2-1727596215617.png

 

3 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

I have solved a similr question in the attached file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

AmeenVanakar
Advocate II
Advocate II

Hi @lbendlin and @Ashish_Mathur 

Thanks for sharing solutions.

I repeated all my steps & found a logical reasoning to the differences in numbers between retention cohort vs repeat although they share same DAX.

Logic:

Since I am using End of month methodology, the cohort analysis is counting all the customers who purchase within the same month as 1 transaction. However I noticed a small group of customers who purchased multiple times within the same month.

Hence, if we check the repeat customers within May'23, the actual repeat is 128 (having more than 1 invoice)

whereas, if we conside all repeats by all customers using End of month methodology & want to know how many customer who purchased in Jun'23 have also purchased May'23, then the answer is 83 as shown in cohort analysis which uses End of month methodology.

 

Here is a screenshot

AmeenVanakar_0-1727758416305.png

 

View solution in original post

3 REPLIES 3
AmeenVanakar
Advocate II
Advocate II

Hi @lbendlin and @Ashish_Mathur 

Thanks for sharing solutions.

I repeated all my steps & found a logical reasoning to the differences in numbers between retention cohort vs repeat although they share same DAX.

Logic:

Since I am using End of month methodology, the cohort analysis is counting all the customers who purchase within the same month as 1 transaction. However I noticed a small group of customers who purchased multiple times within the same month.

Hence, if we check the repeat customers within May'23, the actual repeat is 128 (having more than 1 invoice)

whereas, if we conside all repeats by all customers using End of month methodology & want to know how many customer who purchased in Jun'23 have also purchased May'23, then the answer is 83 as shown in cohort analysis which uses End of month methodology.

 

Here is a screenshot

AmeenVanakar_0-1727758416305.png

 

Ashish_Mathur
Super User
Super User

Hi,

I have solved a similr question in the attached file.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.