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
Pbiuserr
Post Prodigy
Post Prodigy

Number of matching occurrences

Hello, 
Assuming I have two tables

Table1:

Name1

Name2

Name3

 

and Table2

Name1

Name2

Name1

Name2

Name4

Name5

 

Relationship one [Table1] many [Table2]

 

I would like to create a masure that will count, how many values from one side of the relationship, matches values from many side of the relationship (2) and another value how many does not (1)

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Pbiuserr 

try to plot two card visuals with measures like:

count1 = 
COUNTROWS(
    INTERSECT(
        ALL(Table1[Name]),
        ALL(Table2[Name])
    )
)

count2 = 
COUNTROWS(
    EXCEPT(
        VALUES(Table2[Name]),
        VALUES(Table1[Name])
    )
)

 

it worked like:

FreemanZ_0-1678110688942.png

 

View solution in original post

3 REPLIES 3
Ahmedx
Super User
Super User
FreemanZ
Super User
Super User

hi @Pbiuserr 

try to plot two card visuals with measures like:

count1 = 
COUNTROWS(
    INTERSECT(
        ALL(Table1[Name]),
        ALL(Table2[Name])
    )
)

count2 = 
COUNTROWS(
    EXCEPT(
        VALUES(Table2[Name]),
        VALUES(Table1[Name])
    )
)

 

it worked like:

FreemanZ_0-1678110688942.png

 

Thank you! Can you advise what to do if second table has more columns than first one? Tried VALUES etc but does not work

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