ibakecookies
ibakecookies

Reputation: 144

Calculating percentage of survivors per cohort over time in Tableau

In my dataset, I have three columns of data:

CustomerID, BoxCount, MonthCreated
1001        1         Aug 2015
1001        2         Aug 2015
1001        3         Aug 2015
1002        1         Sep 2015
1002        2         Sep 2015

In the screenshot below, I have built a table that displays the count of unique CustomerIDs at each BoxCount level, by cohort (MonthCreated, which is when the customer signed up).

BoxCount level 1 is the full number of people who signed up in MonthCreated X, because everyone who has signed up receives at least 1 box. Then people start cancelling. The number of people who reached BoxCount level 2 for May 2015 (according to the screenshot), is 156,823, or 86.87% of total people who signed up in May (180,525).

I need to create a second column next to the count of customers that displays the % of customers remaining at each BoxCount level, per cohort (people who signed up in the same month).

Tableau Screenshot - Raw Data

I have tried using the Quick Table calculation Percentage of Total, with the computation method being "Table (Down)" but it only seems to work for the first month of MonthCreated. I would like for each subsequent month to have 100% for BoxCount level 1, and the following % to be a portion of the number at each month's level 1. I can't figure out why for July, the % starts at 83.89% and not 100%.

enter image description here

Can anyone help me figure out how to calculate this percentage and also to add it as a new column instead of replacing the column of raw counts?

Thanks!

Upvotes: 0

Views: 414

Answers (1)

bitlamas
bitlamas

Reputation: 742

Looks like you're almost there. Did you try changing the calculation definition by changing the values it summarizes from or the level?

Some example:

Table Calculation

And for it to be replacing the column of raw counts, you can just add the raw counts column again in your view and you'll have both.

Upvotes: 0

Related Questions