4 Replies Latest reply on Jul 21, 2016 3:01 PM by Thanh Cao

# Calculate Returning Customer Percentage

Hi all,

I am trying to calculate how many customers returning from previous years, then get the Percentage of Returning Customer for each year.

I already created a calculation to point out which transaction is returning/initial in the workbook below called: Returning?

However, I can't aggregate the data to count how many Primary Customer ID for each year are returning.

Can someone with rocking Tableau skills help me on this issue?

Thanks a lot,

-Thanh

• ###### 1. Re: Calculate Returning Customer Percentage

Hey Thanh,

Instead of the table calc, I think using a LoD Calculation would be easier.

Something like this:

{FIXED [Primary Customer User ID] : MAX(YEAR([Order Date]))}

>

{FIXED [Primary Customer User ID] : MIN(YEAR([Order Date]))}

Then, you can simply sum a distinct count of user ids to get your counts.

I've attached an example.

• ###### 2. Re: Calculate Returning Customer Percentage

Hi Derrick,

Thank you a lot for the answer.  Can you help a count for each year?

That's my ultimate goal. In the workbook I attached above, 2012 should show 1 returning and 2013 should show 2 returning customers.

Thanks a lot.

-Thanh

• ###### 3. Re: Calculate Returning Customer Percentage

No problem - change the calculation to something like this:

YEAR([Order Date])

>

{FIXED [Primary Customer User ID] : MIN(YEAR([Order Date]))}

And then drag "YEAR" to Rows.

• ###### 4. Re: Calculate Returning Customer Percentage

That's awesome, Derrick. You rock. Thank you a lot.