@Aree ,
This required a complete end-to-end approach. Here are the steps I took:
-
added the Extended Date Table to the model, and marked it as a date table
-
created the active and inactive relationships between the date table and the fact table to account for the three different dates
-
created the DAX measures below
-
dropped the measures into the table below
Active Customers = CALCULATE( COUNTROWS( 'Data' ), 'Data'[Customer Status] = "Active" ) Commencing Customers = VAR SelYr = SELECTEDVALUE( 'Dates'[Year] ) VAR SelMo = SELECTEDVALUE( 'Dates'[MonthOfYear] ) VAR Result = CALCULATE( COUNTROWS( 'Data' ), FILTER( ALLSELECTED( 'Data' ), YEAR( 'Data'[Extract_Date] ) = SelYr && MONTH( 'Data'[Extract_Date] ) = SelMo && YEAR( 'Data'[Commencement_Date] ) = SelYr && MONTH( 'Data'[Commencement_Date] ) = SelMo && 'Data'[Placement_Sequence_Number] = 1 ) ) RETURN Result Exited Customers = CALCULATE( COUNTROWS( 'Data' ), 'Data'[Customer Status] = "Exited" ) Drop Rate = DIVIDE( [Exited Customers], [Exited Customers] + [Active Customers], BLANK() )
Here’s what it looks like all put together:
I would strongly recommend going through the courses below, as they cover all the concepts I have utilized above in this solution.
I hope this is helpful. Full solution file attached.
- Brian
eDNA Forum - Cohort Data Solution.pbix (171.0 KB)