Diego, thank you for the ping.
Hi Tableau Admin :-)
The problem as you explained it
is different than what you've got
in my workbook mentioned above.
What you're trying to calculate is similar
to a moving window distinct count of "uniques".
One would approach this problem in such a way:
1) For each Customer / Year-Month combination
count a number of distinct adjacent months ("in a row")
when SUM([Sales]) for a Customer per Year-Month
is higher than the level (set by a Parameter).
This is done by the [YF : Customer-month #] Table Calculation.
2) For each Customer / Year-Month combination
calculate the MAX() of any value from the step 1 calculation
where all adjacent months are within 12-month moving window.
This is done by the [YF : 12m (Bin)] Nested Table Calculation.
3) Count # of Customers in a particular Bin calculated in the step 2.
This is done using a RANK() technique (frequently mentioned in the Forum).
Please find the attached.
Hope it would be of help.
Customer Churn_YF.twbx 1.4 MB