Merge queries (Power Query) - Microsoft Support (2024)

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel 2021 Excel 2019 Excel 2016 Excel 2013 More...Less

When you merge,you typically join two queries that are either within Excel or from an external data source. In addition, the Merge feature has an intuitive user interface to help you easily join two related tables. For an example of merging total sales from an order details query into a products table, see the Learn to combine multiple data sourcestutorial.

Caution:Privacy Levels prevent a user from inadvertently combining data from multiple data sources, which may be private or organizational. Depending on the query, a user could inadvertently send data from the private data source to another data source that might be malicious. Power Query analyzes each data source and classifies it into the defined level of privacy: Public, Organizational, and Private. For more information about Privacy Levels, see Set privacy levels.

A merge querycreates a new query from two existing queries. One query result contains all columns from a primary table, with one column serving as a single column containing a relationship to a secondary table. The related table contains all rows that match each row from a primary table based on a common column value. An Expand operation adds columns from a related table into a primary table.

There are two types of merge operations:

  • Inline Merge You merge data into your existing query until you reach a final result. The result is a new step at the end of the current query.

  • Intermediate Merge You create a new query for each merge operation.

To see a visual representation of the relationships in the Query Dependencies dialog box, select View > Query Dependencies. At thebottom of the dialog box, select the Layout command to control the diagram orientation.

Merge queries (Power Query) - Microsoft Support (1)

You need at least two queries that can be merged and that have at least one or more columns to match in a join operation. They can come from different types of external data sources. The following example uses Products and Total Sales.

  1. To open a query, locate one previously loaded from the Power Query Editor, select a cell in the data, and then select Query > Edit. For more information see Create, load, or edit a query in Excel.

  2. Select Home > Merge Queries. The default action is to do an inline merge. To do an intermediate merge, select the arrow next to the command, and then select Merge Queries as New.

    The Merge dialog box appears.

  3. Select the primary table from the first drop-down list, and then select a join column by selecting the column header.

  4. Select the related table from the next drop-down list, and then select a matching column by selecting the column header.

    Ensure that you select the same number of columns to match in the preview of the primary and related or secondary tables. Column comparisonis based on the order of selectionineach table.Matching columns must be the same data type, such as Text or Number.You can also select multiple columns to merge.

    Merge queries (Power Query) - Microsoft Support (2)
  5. After you select columns from a primary table and related table, Power Query displays the number of matches from a top set of rows. This action validates whether the Merge operation was correct or whether you need to make changes to get the resultsyou want. You can either select different tables or columns.

  6. The default join operation is an inner join, but from the Join Kind drop down list, you can selectthe following types of join operations:

    Inner join Brings in only matching rows from both the primary and related tables.

    Left outer join Keeps all the rows from the primary table and brings in any matching rows from the related table.

    Right outer join Keeps all the rows from the related table and brings in any matching rows from the primary table.

    Full outer Brings in all the rows from both the primary and related tables.

    Left anti join Brings in only rows from the primary table that don't have any matching rows from the related table.

    Right anti join Brings in only rows from the related table that don't have any matching rows from the primary table.

    Cross join Returns the Cartesian product of rows from both tables by combining each row from the primary table with each row from the related table.

  7. If you want to do a fuzzy match, selectUse fuzzy matching to perform the merge and select from the Fuzzy Matching options. For more information, see Create a fuzzy match.

  8. To include only those rows from the primary table that match the related table, select Only include matching rows. Otherwise, all rows from the primary table are included in the resulting query.

  9. SelectOK.

Result

Merge queries (Power Query) - Microsoft Support (3)

After a Merge operation, you can expand theTablestructured column to add columns from the related table into the primary table. Once a column is expanded into the primary table, you can apply filters and other transform operations. For more information, see Work with a List, Record, or Table structured column.

  1. In the Data Preview, select the Expand Merge queries (Power Query) - Microsoft Support (4) icon next to theNewColumn column header.

  2. In the Expand drop-down box, select or clear the columns to display the results you want. To aggregate the column values, select Aggregate.

    Merge queries (Power Query) - Microsoft Support (5)
  3. You may want to rename the new columns. For more information, see Rename a column.

See Also

Power Query for Excel Help

Learn to combine multiple data sources

Merge queries overview (docs.com)

Left outer join (docs.com)

Right outer join (docs.com)

Full outer join (docs.com)

Inner join (docs.com)

Left anti join (docs.com)

Right anti join (docs.com)

Cross join (docs.com)

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Merge queries (Power Query) - Microsoft Support (6)

Microsoft 365 subscription benefits

Merge queries (Power Query) - Microsoft Support (7)

Microsoft 365 training

Merge queries (Power Query) - Microsoft Support (8)

Microsoft security

Merge queries (Power Query) - Microsoft Support (9)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Merge queries (Power Query) - Microsoft Support (10)

Ask the Microsoft Community

Merge queries (Power Query) - Microsoft Support (11)

Microsoft Tech Community

Merge queries (Power Query) - Microsoft Support (2024)
Top Articles
Prorated: What is Means and How It Impacts Customers
What are Prorated Charges?
Custom Screensaver On The Non-touch Kindle 4
Davita Internet
Hotels
Pbr Wisconsin Baseball
Bed Bath And Body Works Hiring
The Haunted Drury Hotels of San Antonio’s Riverwalk
What Does Dwb Mean In Instagram
Purple Crip Strain Leafly
zopiclon | Apotheek.nl
Enderal:Ausrüstung – Sureai
Jack Daniels Pop Tarts
Echo & the Bunnymen - Lips Like Sugar Lyrics
Https://Store-Kronos.kohls.com/Wfc
Canvas Nthurston
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Kaitlyn Katsaros Forum
Popular Chinese Restaurant in Rome Closing After 37 Years
Self-Service ATMs: Accessibility, Limits, & Features
Drug Test 35765N
Zillow Group Stock Price | ZG Stock Quote, News, and History | Markets Insider
800-695-2780
EVO Entertainment | Cinema. Bowling. Games.
Combies Overlijden no. 02, Stempels: 2 teksten + 1 tag/label & Stansen: 3 tags/labels.
Imagetrend Elite Delaware
Mosley Lane Candles
Earthy Fuel Crossword
Learn4Good Job Posting
Springfield.craigslist
Jambus - Definition, Beispiele, Merkmale, Wirkung
Plato's Closet Mansfield Ohio
The Land Book 9 Release Date 2023
Best Restaurants In Blacksburg
Dollar Tree's 1,000 store closure tells the perils of poor acquisitions
D-Day: Learn about the D-Day Invasion
2700 Yen To Usd
Section 212 at MetLife Stadium
Nba Props Covers
Torrid Rn Number Lookup
Ohio Road Construction Map
Movie Hax
Haunted Mansion Showtimes Near Millstone 14
552 Bus Schedule To Atlantic City
Enter The Gungeon Gunther
Bismarck Mandan Mugshots
Sleep Outfitters Springhurst
Kidcheck Login
Grace Charis Shagmag
Hy-Vee, Inc. hiring Market Grille Express Assistant Department Manager in New Hope, MN | LinkedIn
Predator revo radial owners
La Fitness Oxford Valley Class Schedule
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 5451

Rating: 4.3 / 5 (44 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.