7 Replies Latest reply on Mar 14, 2016 11:39 AM by Derrick Austin

# calculating first time customers?

I want to be able to count the number of new customers per month.

My dataset is

Location: Customer ID: Transaction Date: Transaction Amount

I am trying to think of a way to flag first time customers.  Would returning the max date and then its respective month. and then creating a field that says if todays month= max date month, then "new customer". be the way to go about it?

• ###### 1. Re: calculating first time customers?

Hey Tommy,

MONTH([Transaction Date]) = MONTH({FIXED [CustomerID] : MAX([Transaction Date])}) AND YEAR([Transaction Date]) = YEAR({FIXED [CustomerID] : MAX([Transaction Date])})

• ###### 2. Re: calculating first time customers?

That returned only nulls. I am attaching the screenshot of my calc below in case I made an error

• ###### 3. Re: calculating first time customers?

Can you send over your workbook? Is the transaction date field a Tableau date?

• ###### 4. Re: calculating first time customers?

Hey Derrick!

Over the weekend, i thought i could be over thinking this one a bit.

Couldnt i simply just do min(transaction date) as a calculated field. and do countd(buyer account number) by month in my viz

• ###### 5. Re: calculating first time customers?

You'll have to have CustomerID in the details or it will roll the MIN() up, but if that is all you need, you can easily do something like this:

Minimum Transaction Date, for Customer:

{FIXED [Buyer Account Number] : MIN([Transaction Date])}

Attached an example in Superstore.

1 of 1 people found this helpful
• ###### 6. Re: calculating first time customers?

Great! Thanks.

Now, taking it one step further.  How would i find their 2nd most recent purchase?  I want to find their most recent purchase( max trans date fixed on customer) than see how long that was from their 2nd most recent.

• ###### 7. Re: calculating first time customers?

Hey Tommy,

You can do that by nesting the calculations:

Max Purchase:

{FIXED [Buyer Account Number] : MAX([Transaction Date])}

Second Max Purchase:

{FIXED [Buyer Account Number] : MAX(IF [Transaction Date] != [Max Purchase] THEN [Transaction Date] END)}