Power Query Problems

Excel Power Query Merge: Retrieve Matching Codes from Another Table

Bushra ParveenBushra Parveen Nov 12, 2026 868 views

Question details

The user needs to retrieve a code from one table and add it to a transaction table by matching the JobType column.

Excel Power Query Merge: Retrieve Matching Codes from Another Table
Product
Microsoft Excel Power Query
Device & OS
not provided
Scenario
Table2 contains transaction records and Table1 contains JobType-to-code mappings. The goal is to bring the matching code into Table2.
Observed behavior
The matching code is not yet included in the transaction table; the desired result is to add it through a table merge.
Before you start

Confirm that both tables contain a JobType column with compatible data types, such as text in both tables. Check that the lookup table has one matching code for each JobType to avoid ambiguous results.

Solution 1Recommended

Use a Left Outer merge to add the matching code in Power Query

Use this method when the transaction table must retain every row while adding a code from a related lookup table.

A Left Outer merge keeps all rows from the primary transaction table and matches related rows from the lookup table. After merging, expand the new table column to select the code field.

1
Load both tables into Power Query

In Excel, select the first table and choose Data > From Table/Range. Repeat for the second table, or confirm both tables already appear as queries in the Power Query Editor.

2
Start a merge query

In Power Query Editor, select the transaction query, such as Table2, then choose Home > Merge Queries.

3
Select the matching columns

In the Merge dialog, select Table2 as the first table, select Table1 as the second table, click the JobType column in each preview, and set the join kind to Left Outer.

4
Expand the merged results

Click OK, then select the expand button on the new merged column. Clear the unwanted fields, select the code column, and click OK.

5
Load the result

Review the new code column, then choose Home > Close & Load or Close & Load To to return the merged table to Excel.

Expected result: Every Table2 transaction remains in the output, and each matching JobType receives its corresponding code from Table1.
Free Microsoft Office alternative

Use WPS Office as a Lightweight Alternative for Table Matching Work

WPS Office is a free, lightweight Microsoft Office alternative for opening, editing, and sharing Excel workbooks. It supports common XLSX table formulas and familiar spreadsheet workflows, making migration straightforward when a workbook does not depend on Excel-only Power Query refreshes.

  1. 1. Open the workbook in WPS Spreadsheets: Launch WPS Office, choose Spreadsheets, and open the XLSX workbook containing the transaction and lookup tables.
  2. 2. Create a matching formula: In the transaction table's code column, enter a formula such as XLOOKUP or VLOOKUP that uses JobType to search the lookup table.
  3. 3. Fill and review the results: Copy the formula down the transaction rows, check unmatched results, and save the workbook as XLSX for Excel compatibility.
Open and edit XLSX transaction and lookup workbooks with a familiar spreadsheet interface.Use spreadsheet formulas such as VLOOKUP, XLOOKUP, or INDEX and MATCH for matching codes when Power Query is unavailable.Maintain compatibility with Microsoft Excel XLSX files for easier sharing and migration.Work with a lightweight office suite for everyday spreadsheet editing and table management.
microsoft office alternative - wps office

Frequently Asked Questions

Why should I choose a Left Outer join for this Power Query merge?

A Left Outer join keeps every row from the primary transaction table, Table2, and adds matching fields from Table1. It is appropriate when no transaction should be removed because a JobType has no match.

Which table should be selected first in the Merge dialog?

Select Table2, the transaction table, as the first table if it must remain complete. Select Table1 as the matching lookup table, then choose JobType in both tables.

Why does the merged code column contain null values?

Null values usually mean that JobType is missing from the lookup table or differs between queries because of spaces, spelling, capitalization, or different data types. Compare the values and apply Transform > Format > Trim or Clean.

How do I display the code after merging two Power Query tables?

Click the expand icon on the merged column, select the code field, clear the option to use the original column name as a prefix if desired, and click OK.

Can WPS Office refresh a Microsoft Power Query merge?

Power Query is an Excel feature and may not be available in WPS Office. In WPS Spreadsheets, use compatible XLSX formulas such as XLOOKUP, VLOOKUP, or INDEX and MATCH for equivalent table-matching results.