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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
fingalbrad
Helper I
Helper I

Show matching values from different queries

HI I have a column called Assembly Part Failure ID from one query (excel sheet) and I have another query (excel sheet) with the same Assembly Part Failure ID. 

 

I want to create a custom column showing yes or no as to whether the assembly part failure ID matches a value from the other query and vice versa. 

How do I do this??

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @fingalbrad ,

 

Merge the two tables by both columns, M code for your reference.

 

let
    Source = Table.NestedJoin(Table1, {"Assembly Part", "id"}, Table2, {"Assembly Part", "id"}, "Table2", JoinKind.LeftOuter),
    #"Expanded Table2" = Table.ExpandTableColumn(Source, "Table2", {"Assembly Part"}, {"Table2.Assembly Part"})
in
    #"Expanded Table2"

merge.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @fingalbrad ,

 

Merge the two tables by both columns, M code for your reference.

 

let
    Source = Table.NestedJoin(Table1, {"Assembly Part", "id"}, Table2, {"Assembly Part", "id"}, "Table2", JoinKind.LeftOuter),
    #"Expanded Table2" = Table.ExpandTableColumn(Source, "Table2", {"Assembly Part"}, {"Table2.Assembly Part"})
in
    #"Expanded Table2"

merge.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
d_gosbell
Super User
Super User

In the query editor on the far right hand side of the Home ribbon is a section called "Combine" and in this section is a button called Merge. If you choose this you can do a Left join between your 2 queries joining on the "Failure Part ID" so that you get all the rows from Query 1 and only rows from Query 2 where the selected Part Failure ID exists. Then you could add a calculated column that returns Yes if the ID from query 2 is not blank and a no if it is blank.

HI @d_gosbell 

After I create the merged table could I just then filter out the blanks? And have it do all these steps each time I refresh the data?



 


After I create the merged table could I just then filter out the blanks? 




Yes, you can do whatever you like with the merged queries. You'd basically bring in one or more columns from the second query then it's up to you what you do with these column,

 


And have it do all these steps each time I refresh the data?



I'm not sure what you mean by "do all these steps". If you mean setting up the merge join, then no, you can save that as part of the steps for query 1 and then it will do the join to query 2 automatically each time you run a refresh.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors