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

RELATED in Power Query

Hello,

 

I usually use DAX, not Query so I struggle with a problem.

Because I have big source files, I deleted a lot of lines by using Query before working on Dax.

However, one of my user told me that there are a few exception lines that I deleted which souldn't be eliminated. These lines can be easily identified by using RELATED with another table and adding a simple formula. However I cannot do that in DAX because there lines are already deleted in Query.

My question is : Is it possible to do a related in Power Query ? If yes, what is the code to add in the request.

 

Thank you.

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

If you're just needing to identify missing rows that should match with other tables, then you should do a merge in Power Query.

Select the table that contains the records that need to be matched, go to the Home tab > Merge Queries > Merge Queries as New.

In the dialog that opens, select the field from the first window that your tables are related on in the data model, then select your second table in the second window (the one that your RELATED function directs to), and select the corresponding field that this table is related on.

Start with using a LEFT OUTER join.

Once you hit ok, you will essentially have a single table that mimics the virtual table that is created when your tables have been related in the data model.

You should see blank rows on the right hand side of the join that don't match your left hand side table. Thse, presumably, will be the rows you need to reinstate.

 

You can experiment using RIGHT OUTER, FULL OUTER, LEFT/RIGHT ANTI joins in order to match up the tables in different ways, and manipulate which rows are displayed/removed during the join.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thank you BA_Pete for your help. I will try to use this solution for my problem.

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

If you're just needing to identify missing rows that should match with other tables, then you should do a merge in Power Query.

Select the table that contains the records that need to be matched, go to the Home tab > Merge Queries > Merge Queries as New.

In the dialog that opens, select the field from the first window that your tables are related on in the data model, then select your second table in the second window (the one that your RELATED function directs to), and select the corresponding field that this table is related on.

Start with using a LEFT OUTER join.

Once you hit ok, you will essentially have a single table that mimics the virtual table that is created when your tables have been related in the data model.

You should see blank rows on the right hand side of the join that don't match your left hand side table. Thse, presumably, will be the rows you need to reinstate.

 

You can experiment using RIGHT OUTER, FULL OUTER, LEFT/RIGHT ANTI joins in order to match up the tables in different ways, and manipulate which rows are displayed/removed during the join.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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.

Top Solution Authors