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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ROG
Contributor III

Returning customers based on the ID column

Hi guys,

 

How can I calculate the number of returning custmers based on the ID column?

If an ID appears more than once, it means they're return customer.

 

Thanks!!

1 ACCEPTED SOLUTION
bhanu_gautam
Honored Contributor III

Sorry for this try using this it is working attaching PBIX file

 

Returning Customers = COUNTX(FILTER(SUMMARIZE('Table', 'Table'[CRM ID]), CALCULATE(COUNT('Table'[CRM ID])) > 1), 'Table'[CRM ID])





Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

4 REPLIES 4
bhanu_gautam
Honored Contributor III

@ROG , You can achieve this using measure

 

returning_customers = COUNTROWS(FILTER(SUMMARIZE('Table', 'Table'[ID]), CALCULATE(DISTINCTCOUNT('Table'[ID])) > 1))




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thanks @bhanu_gautam 

Unfortunately, it's giving me blank. Any advice please?

 

Returning Users = COUNTROWS(FILTER(SUMMARIZE('Smart FAQ''s', 'Smart FAQ''s'[crm_id]), CALCULATE(DISTINCTCOUNT('Smart FAQ''s'[crm_id])) > 1))

% Returning Users = [Returning Users]/[No of users]
ROG_0-1718969154182.png

 






bhanu_gautam
Honored Contributor III

Sorry for this try using this it is working attaching PBIX file

 

Returning Customers = COUNTX(FILTER(SUMMARIZE('Table', 'Table'[CRM ID]), CALCULATE(COUNT('Table'[CRM ID])) > 1), 'Table'[CRM ID])





Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






rajendraongole1
Esteemed Contributor II

Hi @ROG - create a count of ids using calculated columns as below:

 

IDCount = COUNTX(FILTER('TableID', 'TableID'[ID] = EARLIER('TableID'[ID])), 'TableID'[ID])

 

create a measure to count the number of returning customers -IDs appearing more than once

Measure:

 

ReturningCustomers =
CALCULATE(
DISTINCTCOUNT('YourTable'[ID]),
'YourTable'[IDCount] > 1
)

Hope it works.

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Top Kudoed Authors
Users online (27)