Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

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?

 

 

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