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

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard