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
Axiomite
Resolver II
Resolver II

Calculate where total of distinctcount based on condition

Hi there,

I would like to to calculate the total of repeats/returning customers for a certian period. 

So my first measure for the below "Distinct email Count", I use = CALCULATE(DISTINCTCOUNT(Table[Column]
Then a simple = 
IF([Distinct email Count] > 1, "Returning", "Not")

 

How will I be able to get the total of value for Returning and for Not? 

Sample.jpg

 

I know there are a couple of articles on New, Lost Customers but just looking for a simplified version of identifying returning customers for a sanity check. 

Any ideas? 

 

Kind regards

 

 

1 ACCEPTED SOLUTION

@amitchandak - thanks for your reply. I might not have been clear with question, however, I managed to get it working with 

SUMX(VALUES(Sales[Customer_email]), IF(Measures[Returning Customer] = "Returning", 1, 0)). 
 
Thanks and regards

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @Axiomite ,

 

If the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.😊


Best Regards,
Henry

amitchandak
Super User
Super User

@Axiomite ,

Returning = countx( filter(summarize(Table, Table[Year], Table[Month], Table[email], "_1", CALCULATE(DISTINCTCOUNT(Table[Column] )) ) , [_1] >1) ,[email] )

 

not = countx( filter(summarize(Table, Table[Year], Table[Month], Table[email], "_1", CALCULATE(DISTINCTCOUNT(Table[Column] )) ) , [_1] <=1 ) ,[email] )

@amitchandak - thanks for your reply. I might not have been clear with question, however, I managed to get it working with 

SUMX(VALUES(Sales[Customer_email]), IF(Measures[Returning Customer] = "Returning", 1, 0)). 
 
Thanks and regards

Kudos to you !!

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.