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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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] )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@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 !!

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors