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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Cohort Analysis Question

Dear experts, 

 

I had this issue while creating the cohort chart 

 

"The resultset of a query to external data source has exceeded the maximum allowed size of '1000000' rows'".

 

This happened when I selected all the regions we have (4 regions). Is there any way to show the number of all regions?

 

Here is my DAX:

 

Cohort = 
var n_month=MAX('After Months'[Value])
var tbl_current=VALUES('Sales'[Store_ID])
var tbl_n=CALCULATETABLE(VALUES(Sales[Store_ID]),DATEADD(dim_time[Date],n_month,MONTH))
var tbl_inner=INTERSECT(tbl_current,tbl_n)
return
COUNTROWS(tbl_inner)

Another thing is when I tried to create a percentage cohort chart, I wanted the month 0 to be 100% but it showed as less than 100% instead, is it possible to show it 100% regardless the filter I choose?

 

anhdoox_0-1670915981045.png

 

Here is my current DAX

 

Cohort % = 
var n_month=MAX('After Months'[Value])
var tbl_current=VALUES('Sales'[Store_ID])
var tbl_n=CALCULATETABLE(VALUES(Sales[Store_ID]),DATEADD(dim_time[Date],n_month,MONTH))
var tbl_inner=INTERSECT(tbl_current,tbl_n)
return
DIVIDE( COUNTROWS(tbl_inner),COUNTROWS(tbl_current))

 

Thanks a lot in advance!

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , I have used a little bit of different measures, check if those can help

Power BI Cohort Analysis, Customer Retention %- https://youtu.be/qY1SDF1cwsg

https://community.powerbi.com/t5/Quick-Measures-Gallery/Customer-Retention-Part-3-Period-Of-Stay-Cohort-Analysis/m-p/1393332#M630

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak 

 

Thanks for your solutions, as far as I see your DAX only measures the new customers in month 1 instead of all customer right? My intention is to see all customers in month 0 and how they retained after that. Can you suggest me how to improvise my current DAX please?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.