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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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