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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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