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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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