Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
77 | |
76 | |
44 | |
31 | |
26 |
User | Count |
---|---|
97 | |
89 | |
52 | |
48 | |
46 |