Reconciliations are a common and time-consuming task for finance and data professionals. At their simplest, they involve comparing two sets of information to check that the values agree. When they don’t, we need to identify the differences and investigate why they exist.
Power Query can automate the comparison. Instead of working down two lists and ticking off matching items, we can produce a list containing only the records that need attention.
The approach works particularly well when both inputs contain a shared reference. We’ll use a payroll example, but the same three-step method applies to other reconciliations:
- Create a unique list of references from both inputs.
- Merge both sets of values back into that unique list.
- Calculate the variance and retain only the differences.
What You'll Learn
- Build a unique reference list from both inputs so records missing from either source are included.
- Merge source amounts into the reference list and replace missing amounts with zero before calculating variances.
- Filter out zero variances and check that the remaining total matches the original difference.
- Group and sum repeated source references before merging to compare one amount per reference.
The Example: Reconciling a Listing to Payroll
Our first input is a table called Listing. It contains an employee name, reference, start date, gross value, cost center, and region. Think of this as the information we send to a third-party payroll provider.
The provider returns a second table called Payroll. The gross totals are:
- Listing: £4,092,558.19
- Payroll: £4,092,099.86
- Difference: £458.33
We know the totals do not agree. What we need is a breakdown of the individual records making up that £458.33.
Both tables are already loaded into Power Query as queries named Listing and Payroll. You can get the example file to follow along.
Step 1: Create a Unique List of References
Our reconciliation needs to include every employee appearing in either input. Starting with just one table could leave out employees who exist only in the other.
To avoid that, we’ll append the two queries and then remove duplicate references.
Standardize the column headings
The equivalent columns have different headings in the source tables:
- Listing uses Employee Name and Ref.
- Payroll uses Name and Number.
Before appending, rename Employee Name to Name in Listing, and rename Number to Ref in Payroll.
This matters because an append aligns columns by their headings. Giving the equivalent fields the same names places their values into the same columns.
Append the queries as a new query
- On the Home ribbon, open the Append Queries dropdown.
- Select Append Queries as New.
- Choose the Two tables option.
- Select Listing as the first table and Payroll as the second.
- Click OK.
- Rename the new query Reconciliation.
This gives us a combined list containing the records from both inputs.
Keep the identifying columns and remove duplicates
In Reconciliation, select Name and Ref, then right-click and choose Remove Other Columns.
Next, select only the Ref column, right-click, and choose Remove Duplicates.
Use the reference, not the employee name, to determine uniqueness. Names can change, for example after marriage. A name change should not cause the same employee to be treated as two different people.
The result is a unique list of employee references across both sources, with a name alongside each reference to make the reconciliation easier to read.
Step 2: Merge Both Inputs Back into the Unique List
Now we have the complete reference list, we need the gross value from each source beside it. We’ll merge Listing first, then repeat the process for Payroll.
Merge the Listing query
- Select the Reconciliation query.
- Choose Home > Merge Queries.
- Select Listing as the second query.
- Select Ref in both previews as the matching column.
- Keep the Left Outer join so every reference in Reconciliation remains in the result.
- Click OK.
The match count in the merge dialog provides an early clue. In this example, Listing matches 740 of the 743 rows in our unique list. That means three references in the combined list do not appear in Listing.
The merge adds a Listing column containing nested tables. Click its expand button, select only Gross, and leave Use original column name as prefix selected.
The expanded column is named Listing.Gross. Keeping the prefix makes it clear which source the value came from, especially because both inputs call the original column Gross.
Replace missing values with zero
References without a matching Listing record have null in Listing.Gross. For this comparison, we want to treat an absent amount as zero.
- Select Listing.Gross.
- Choose Transform > Replace Values.
- Enter null as the value to find.
- Enter 0 as the replacement.
- Click OK.
This is important because subtracting a null value would return null rather than the numeric difference we need. Replacing it with zero lets a record appearing in only one source produce a variance.
Merge the Payroll query
Repeat the same process for the second input:
- With Reconciliation selected, choose Home > Merge Queries.
- Select Payroll as the second query.
- Match Ref to Ref, keeping the Left Outer join.
- Click OK.
- Expand the Payroll column and retain only Gross, keeping the original column name as a prefix.
- In Payroll.Gross, replace null with 0.
Fantastic. We now have one row for each employee reference, with the Listing and Payroll gross values side by side.
Step 3: Calculate the Variance
The final comparison is simply the Listing gross value minus the Payroll gross value.
- Choose Add Column > Custom Column.
- Name the new column Variance.
- Enter
[Listing.Gross] - [Payroll.Gross]as the custom column formula. - Click OK.
Most variances should be zero if the two inputs are broadly similar. Those are the records where the gross amounts agree, so we can remove them from our investigation list.
Open the filter dropdown on Variance, uncheck 0, and click OK. The filter should retain rows where Variance does not equal zero.
Set the Variance column’s data type to Decimal Number, then choose Home > Close & Load to load the reconciliation into Excel.
Check the Result Against the Original Difference
Back in Excel, select the loaded reconciliation table and enable its Total Row. Sum the Variance column.
The total is £458.33, matching the difference between the two original gross totals. We now have the individual lines that explain that overall difference.
Because we calculated Listing minus Payroll:
- A positive variance means the Listing amount is higher.
- A negative variance means the Payroll amount is higher.
- A record present in only one input is compared against zero in the other.
Power Query has done the comparison, but it has not explained the business reason for each difference. That still requires investigation, which may involve speaking to the payroll provider or other people in the organization.
Finding the differences is the automated part. Understanding and resolving them is what completes the reconciliation.
What If the References Are Not Unique?
This example works neatly because each source has one gross value per employee reference. Your data may contain several rows for the same reference.
For example, Aliya Wilson, reference 69, appears twice in the sample data, with gross values of approximately 2,379 and 3,212. Before using the reconciliation method, we need to bring those records together into one amount for that reference.
The solution is Group By. Apply this preparation to any source containing multiple rows per reconciliation reference, before creating the unique list and merging the values.
- Select the column or columns that define the reference for your reconciliation.
- Choose Transform > Group By.
- Name the new aggregated column Gross.
- Set the operation to Sum.
- Select the source Gross column as the column to sum.
- Click OK.
This produces a single total for each reference. The unique list and subsequent merges can then work with one comparable amount from each source.
The important distinction is that removing duplicates builds the reference list; grouping and summing prepares repeated source amounts. We do not want to discard valid payment rows when we need their combined value.
Connect to the Sources Without Copying and Pasting
The example uses two tables in one workbook, but the source data does not need to live together. Power Query can connect to each source individually and bring the information into the reconciliation.
That means there is no need to copy and paste values from different workbooks just to compare them. Once the query steps are in place, refreshing the queries reapplies the same preparation, merges, and variance calculation.
The method is straightforward: build a complete reference list, bring in both sets of amounts, and keep only the differences. Power Query takes care of the repetitive comparison so we can spend our time investigating the items that actually need attention.


