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
flights
Frequent Visitor

Create a measure for a count of a distinct count

Hi Guys,

 

I am trying to measure repeat customers based on email addresses. As some customers make multiple purchases on the same day, I have added another column which combines date and email address called EmailDate I have a matrix which then looks at the email address, and the distinct count of EmailDate, and therefore any which returns 2 and over are repeat customers for the period I am looking at. So for example - 

 

The original data looks like

 

Email                                                   Booking Date                         EmailDate

Dave@address.com                            11/12/2018                            Dave@address.com 11/12/2018

Dave@address.com                            11/12/2018                            Dave@address.com  11/12/2018

Dave@address.com                             08/12/2018                           Dave@address.com  08/12/2018

Dave@address.com                             09/12/2018                           Dave@address.com  09/12/2018

 

etc etc etc. 

 

And so my matrix looks like - 

 

Email                                                  (Distinct) Count of EmailDate

Dave@address.com                                3

Meg@address.com                                 2

Jane@address.com                                 1

 

I need a measure of all of the results from the matrix that are 2 and above, so that I can calculate how many customers are repeat customers in the period. 

 

Hope that makes sense! 

 

Cheers 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this measure

 

=COUNTROWS(FILTER(SUMMARIZE(VALUES(DATA[Email]),[Email],"ABCD",DISTINCTCOUNT(Data[Booking Date])),[ABCD]>=2))

 

Hope this helps.


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

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Try this measure

 

=COUNTROWS(FILTER(SUMMARIZE(VALUES(DATA[Email]),[Email],"ABCD",DISTINCTCOUNT(Data[Booking Date])),[ABCD]>=2))

 

Hope this helps.


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

THANKYOU SO MUCH!!!!!!!!!! Ashish you're a legend. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-juanli-msft
Community Support
Community Support

Hi @flights

Create a measure

Measure = CALCULATE(DISTINCTCOUNT(Sheet2[Booking Date]),ALLEXCEPT(Sheet2,Sheet2[Email ]))

3.png

 

Best Regards

maggie

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.