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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Power Query output value based on matching values from different tables

Hey Power BI users,

 

I am currently trying to narrow down my table rows by filtering. However I need to filter based on a specific value which is not present in one of the tables.

 

Case:

2 tables, Customer and Product.  Both have millions of rows, out of which only about 500.000 are needed.

Table customer has a unique Customer ID (However its saved multiple times, due to it being saved on multiple dates) To this table I have added a unique row named: 'IsNeeded' with the value 1 and 0 based on a certain criteria (The same criteria can't be used on the other table). All 0's have been filtered.

 

I want to output the 1 and 0 in the 'Product' table, based on the value off the Customer ID (Dates don't impact the outcome).

 

I want to lookup the Customer ID on table 'Customer' and match it with the same Customer ID on table 'Product' and then output (if customer Id matches) the value that is in Table 'Customer[IsNeeded]'.

 

What can I do to achieve this?

 

Thank you in advance,

Daniël

1 ACCEPTED SOLUTION

@Anonymous,

 

You may use Merge Queries (Table.NestedJoin) in Query Editor.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
PattemManohar
Community Champion
Community Champion

@Anonymous Any sample data and expected output will be helpful. But from your post, I can understand you are looking for "LOOKUPVALUE" function.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

(EDIT: I want this to be done in the Power-Query editor)

Sure thing. 

 

Table: Customer                                                                        Table: Product             (expected output)

CustomerID       Employee         IsNeeded                                Customer ID               IsNeeded

12345                  1                      1                                             12345                         1

23456                  2                      0                                             34567                         1

34567                  1                      1                                             23456                         

45678                 4                       1                                             45678                         1

 

Based on the specific value of Employee (name) I created the IsNeeded column value. However the Employee column is not in the Product table.

Therefore I would like to lookup and compare matching values of the two Customer ID's and if they match, output the value that is written on the Customer[IsNeeded]

 

Thank you,

Daniël

@Anonymous,

 

You may use Merge Queries (Table.NestedJoin) in Query Editor.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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