5 Replies Latest reply on Aug 21, 2018 10:23 AM by Deepak Rai

# How to do count of distinct by customer?

Hi I am attaching a workbook where i am looking at my customers, the date they made a payment and the payment amount: below is my excel that i am linking to tableau. i like to get a distinct count of my customers, distinct count of date by customer, average payment by customer and average payment by date of service so for example, i have 3 unique customers, 4 unique dates by customers and average amount for customer A is 80, average paid amount for customer B is 30 but how do i get average amount for customer D since he has 2 unique dates. so his average will be 40+60=100. 100/2=50(since he has 2 unique dates)

i know how to get unique customers. it's countD (customers)

i know how to get unique dates: {fixed(customer):countD(date)}

i know how to get sum paid amount

i know how to get average amount by customer

but how do i get average paid by unique date and customer? (see the second screenshot)

excel:

• ###### 1. Re: How to do count of distinct by customer?

{SUM(Paid Amount)}/{COUNTD(Customer)}

• ###### 3. Re: How to do count of distinct by customer?

Hi Tony,

Looks Like you want This

Thanks

Deepak

1 of 1 people found this helpful
• ###### 4. Re: How to do count of distinct by customer?

Thanks Deepak!! you are a genius when it comes to this stuff

• ###### 5. Re: How to do count of distinct by customer?