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
Forrestgump
Frequent Visitor

Count where the join fields are equal

Hi All,

 

I have 2 tables in Power BI which are Bi-Directionally linked. The unique Identifiers have a 1 to 1 relationship. In the first table SurveyTable there are 2,532 records in the second table there are 23,409. In the second table I have a field called primary segments. What I what to do is a count of Primary Segments where the join is equal between the 2 tables. I did this in Access and I know the answer is 2,341. I thought I might have to do a Calculate query something like:-

 

Calculate(CountRows(Surveydata[ID],Headcount[PrimarySegment]) but this does not work. Any help would be greatly appreciated.  

5 REPLIES 5
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Forrestgump,

Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi there,

 

Unfortunately I haven't been able to find the solution to the problem.

 

Kind regards,

 

Forrestgump

Forrestgump
Frequent Visitor

Hi There,

 

I have a bi-directional join within Power Bi between 2 tables. The headcount table has 23,409 rows of data, the survey data has 2,532. Within the headcount data there is a field called Primary Segment. What I what to do is to do a count of Primary Segments where the join field is equal. I did this within access and the answer was 2,341. I am not sure how to achieve this in powerbi. I thought it might be a calculate function something like:-

 

Calculate(CountRows(SurveyData[ID],Headcount[PrimarySegment])

 

However, no luck. Any help would be appreciated.

 

Kind regards,

 

James Elwell

Hi @Forrestgump,

Based on my test, you could refer to below steps:

Sample data:

1.PNG

Create a measure:

a = COUNTROWS(FILTER('Surveydata',RELATED(Headcount[primary segments])<>BLANK()))

Result:

3.PNG

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Stachu
Community Champion
Community Champion

try something like this

Measure = CALCULATE(COUNT(Surveydata[ID]),KEEPFILTERS(Headcount[PrimarySegment]))


Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors