Forum Discussion
pg1980
Helper II
3 years agoA cohort analysis (matrix visual)
Hi! I have to be able to make a cohort analysis (in a matrix visual). In this analysis I have to sum up the quantity values by “year-month New” and go substracting this number to the total quantity ...
- 3 years ago
pg1980
See attached updated sample fileMeasure = VAR MonthDiff = MAX ( 'Months Difference'[Months] ) VAR T1 = FILTER ( 'Table', DATEDIFF ( 'Table'[year-month New], 'Table'[year-month Out], MONTH ) >= MonthDiff - 1 ) VAR T2 = FILTER ( T1, DATEDIFF ( 'Table'[year-month New], 'Table'[year-month Out], MONTH ) >= MonthDiff ) RETURN DIVIDE ( SUMX ( T2, 'Table'[Quantity] ), SUMX ( T1, 'Table'[Quantity] ) ) + 0