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

    How to do count of distinct by customer?

    Tony Fahd

      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: