web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Power Query Merge base...
Power Apps
Unanswered

Power Query Merge based on conditions

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

 

I am trying to merge two tables, and I think I need to do the merge based on conditions.  The first table is a list of all finished inventory, which includes the end customer name, city and state.  The second table is a list of customers and which warehouse each should go to.  I want to use Power Query to add the warehouse to the inventory listing.  (I am currently using an Excel formula, but the inventory list is long and performance is very poor.)  The issue is that our criteria for sending material to a warehouse can vary by customer, as shown in the image below.  How can I set up a merge with the following conditions?

- If the customer list specifies the customer name only (city shows 'all' and state shows 'all') then merge based on the customer name only

- If the customer list specifies the customer name and state (and city shows 'all'), then merge based on the customer name and state

- If the customer list specifies the customer name, city, and state, then merge based on all 3 fields

 

CustomerCityStateWarehouse
ABC Co.DenverCOW1
ABC Co.BoulderCOW2
DEF Co.allallW3
GHI Co.allOHW1
GHI Co.allWAW2

 

Desired Result:

Serial NoProductCustomerCityStateWarehouse
1234Blue bikeABC Co.DenverCOW1
1235Red bikeABC Co.DetroitMI<blank>
1236Green bikeXYZ Co.New YorkNY<blank>
1237Blue bikeGHI Co.ClevelandOHW1
1238Red bikeDEF Co.TaylorMIW3
1239Green bikeGHI Co.New YorkNY<blank>

 

All help appreciated!

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard