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
Anonymous
Not applicable

Look uo for matching fields from two different data sets

For each 'cid' in Table 1 , I want to look up for a match in table 2  against the 'companyid,'  . Table 3 should contain all the matches for the companyid field from Table2 .

 

Table1

dc , cid, name 

--------------------

dc1, DC9098, xyc

dc2, DC9081, xyc

dc3, DC9041, xyc

 

Table2 

id , companyid, client, date 

-----------------------------------

1, DC9098, SPA,10/12/20

2, DC9081,APPL,30/31/19

3, DC9081,GOOG,30/31/19

4, DC9081,RAS,10/31/19

5, DC9031,RAS,10/31/19

 

Table 3 

id , companyid, client, date 

-----------------------------------

1, DC9098, SPA,10/12/20

2, DC9081,APPL,30/31/19

3, DC9081,GOOG,30/31/19

4, DC9081,RAS,10/31/19

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Maybe:

Table 3 =
  VAR __cids = ALL('Table1'[cid])
RETURN
  FILTER(ALL('Table2'),[companyid] IN __cids)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous Maybe:

Table 3 =
  VAR __cids = ALL('Table1'[cid])
RETURN
  FILTER(ALL('Table2'),[companyid] IN __cids)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hey @Greg_Deckler Thanks that helped ! Also I figured out the creating a view using merge queries to be effecient in terms of time space complexity. Like so :

 

= Table.NestedJoin(Table2, {"companyId"}, Table1, {"companyId"}, "Table1", JoinKind.Inner)

 

src: https://docs.microsoft.com/en-us/power-query/merge-queries-overview

 

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