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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
MTOnet
Helper III
Helper III

Count Linked Records When an Intermediary Table Creates the Relationship Between Two Tables

I have data in 3 tables.  I am trying to count how many records are in the third table, which are related to items in the first table.  There is an intermediary table between the two that establishes the relationship.

Sample Data

Table A

RecordALinkedRecordB
123210
124 
125211
126212
127 

Table B

RecordBLinkedRecordC
210380
211 
212381

Table C

RecordC
380
381
383

In this example, there would be items in Table C, linked to Table A.  

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @MTOnet ,

Here are the steps you can follow:

1. Connect the relationship between the three tables

v-yangliu-msft_0-1617257840289.png

2. Create measure

count =
CALCULATE(COUNT(TableC[RecordC]),FILTER(ALL(TableA),[LinkedRecordB]<>BLANK()))

3. Result.

v-yangliu-msft_1-1617257840292.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @MTOnet ,

Here are the steps you can follow:

1. Connect the relationship between the three tables

v-yangliu-msft_0-1617257840289.png

2. Create measure

count =
CALCULATE(COUNT(TableC[RecordC]),FILTER(ALL(TableA),[LinkedRecordB]<>BLANK()))

3. Result.

v-yangliu-msft_1-1617257840292.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @MTOnet 

 

What is the expected result? Is Record A distinct in Table A, and Record B distinct in Table B? And you want a DAX calculated column in Table C?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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