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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
SeanPolley_Apty
Frequent Visitor

Count matching ID's from one table to a another

Problem:
I need to count how many matching ID numbers make it from Table 1 (Stage 1) to Table 2 (Stage 2) in order to calculate the conversion rate from Stage 1 to Stage 2.

Table 1 (Stage 1)

ID Value (string)Stage
123AStage 1
456BStage 1
789CStage 1


Table 2 (Stage 2)

ID Value (string)Stage
123AStage 2
999DStage 2
789CStage 2


In this example I would like to figure out my conversion rate from stage 1 to stage 2. How can I count that two ID's from Stage 1 made it to Stage 2 (123A and 789C)? Once I get the count which would be 2 in this case, I can take that and divide over the total ID count in Stage 2 to get a 2/3 or 66% conversion rate.

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @SeanPolley_Apty 

 

Download sample PBIX file

 

You can use INTERSECT to see which ID's are in both tables, then COUNTROWS of the table resulting from the INTERSECT

 

 

Measure = COUNTROWS(INTERSECT(VALUES(Table1[ID Value]),VALUES('Table2'[ID Value])))

 

 

Your conversion rate would then be

Conversion Rate = DIVIDE([Measure], COUNTROWS('Table2'))

 

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

1 REPLY 1
PhilipTreacy
Super User
Super User

Hi @SeanPolley_Apty 

 

Download sample PBIX file

 

You can use INTERSECT to see which ID's are in both tables, then COUNTROWS of the table resulting from the INTERSECT

 

 

Measure = COUNTROWS(INTERSECT(VALUES(Table1[ID Value]),VALUES('Table2'[ID Value])))

 

 

Your conversion rate would then be

Conversion Rate = DIVIDE([Measure], COUNTROWS('Table2'))

 

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


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 MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.