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.
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.
Solved! Go to Solution.
Hi,
Try this
=DISTINCTCOUNT(Data[OrderDate])
Hope this helps.
Hi,
Try this
=DISTINCTCOUNT(Data[OrderDate])
Hope this helps.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
99 | |
73 | |
72 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |