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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
thekeyjh
Regular Visitor

Comparing Single Column in Two Tables

I'm new to PowerBI and I have two tables that I am trying to compare named WorkDay and PCPros. Each table has a column titled EmployeeID.  I am trying to display all the rows in PCPros where there is a matching EmployeeID in WorkDay. Any idea how to do this in PowerBI/Power Queary Editor?

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

M Code

NewStep=let a=Table.Buffer(Table.Group(WorkDay,"EmployeeID",{"n",each 1})) in Table.SelectRows(PCPros,each a{[EmployeeID=[EmployeeID]]}?<>null)

View solution in original post

4 REPLIES 4
wdx223_Daniel
Super User
Super User

M Code

NewStep=let a=Table.Buffer(Table.Group(WorkDay,"EmployeeID",{"n",each 1})) in Table.SelectRows(PCPros,each a{[EmployeeID=[EmployeeID]]}?<>null)

That works! Thank you!

 

How do I change the query to pull only the EmployeeIDs that don't match?

NewStep=let a=Table.Buffer(Table.Group(WorkDay,"EmployeeID",{"n",each 1})) in Table.SelectRows(PCPros,each a{[EmployeeID=[EmployeeID]]}?=null)

Thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.