Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sharmon9000
Helper I
Helper I

Calculating Total of Repeat Customers with multiple orders on a single counting as 1

This seems like a simple question, but I cant seem to get my desired results. 

 

I am trying to calculate repeat customers.  To start, I load the data into the table using SQL code that only loads customers that have repeat orders.   

 

Each row consists of Name, OrderDate, Address, City, Zip. 

 

   John Williamson |  10/20/2017 | 123 Broadway Ave. | Chicago | 32345

  John Williamson |  10/20/2017 | 123 Broadway Ave. | Chicago | 32345

  John Williamson |  11/12/2017 | 123 Broadway Ave. | Chicago | 32345

  John Williamson |  10/20/2017 | 123 Broadway Ave. | Chicago | 32345

  Beth Houthley   |  09/21/2017 | 232 Chester Rd.   | Atlanta | 94032

  Beth Houthley   |  10/12/2017 | 232 Chester Rd.   | Atlanta | 94032

 

With only repeat customers loaded into the table, I would now like to count how many DISTINCT orderdates each customer has.  So if using the sample data above as an example, both John Williamson and Beth Houthley would have a count of 2; because they have a DISTINCT date count of 2. 

 

Then I would like to use a Matrix visual that would show each customers total repeats.  No matter what I try I cant seem to get this to work correctly.   

 

Any help or push in the right direction would be nice.

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

  1. Drag Name to the visual
  2. Write this measure

 

=DISTINCTCOUNT(Data[OrderDate])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

  1. Drag Name to the visual
  2. Write this measure

 

=DISTINCTCOUNT(Data[OrderDate])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for the quick response.   This was exactly what I needed.  I used this with CALCULATE to get the 2017, and Last 30 Days total:

 

Last 30 Days Measure:

# Last 30 Days Total = CALCULATE(DISTINCTCOUNT(Query1[DeliveryDate]), Query1[DeliveryDate] >= TODAY()-30) 

Thanks again Ashish, I appreciate it!  

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.