Merging data from two pivot tables

TomBird

New Member
Joined
Feb 20, 2025
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have two datasets, one has miles driven consolidated under an airport code. So I have a list of airport codes and all the miles associated with that code.

Domicile Airport CodeMiles
ABE 8,501,114
ATL 16,904,451
AVP 3,808,334
BDL 15,222,934

I have a second dataset that is a list of claims and each claim has what airport code the driver works out of, thus I can have many claims from the same airport code. I have a pivot table to group all the claims and how much we paid by the airport code. What I cannot get Excel to do is combine the two datasets into one.


Coverage-AirportAccident CountTotal Expenses (Paid & Reserves)Total Indemnity (Paid & Reserves)Total Incurred
ATL24$51,060$1,423,514$1,469,724

What I want is the ATL miles from the table above, 16,904,451 tacked on the end of the above row from the pivot table. This has to be dynamic as the Miles table and the claims table are updated each month so doing a lookup "outside" the pivot table will not work, plus, I want to get summary information on the miles as well as what we paid.

I have tried linking the tables with the Airport code as a key and adding the miles in the pivot but I think it is taking every row in the pivot and summing the miles and presenting the total for every line.
Was thinking of pulling both root tables the pivot tables pull from into powerquery and relating but again I cannot think of how the consolidate them into one because they both need to be filtered down into the one airport code for them to relate.

Seems like I need one static table that has been pivoted, then the other pivoted data can look up the miles like I have in the example above. Clear as mud right?

Any thoughts here?
 
not seeing input data is not so easy (at least for me) to propose strightforward solution.

But trying to brainstorm a bit and thinking about the way of fooling a bit pivot table :) on how to avoid "summing the miles and presenting the total for every line":

The accident count for each airport can be easily calculated with simple COUNTIF. And you could add to your first dataset a column with. Miles/acc. count. Then when summing occurs the original total miles shall be restored back.
 
Upvote 0
Do you actually need the output to be a pivot table specifically? If so, I'd just link the two and use an average for the miles (since they will be the same for every row). If not, I'd use Power Query to aggregate each dataset, then combine the two and output them as a table.
 
Upvote 0

Forum statistics

Threads
1,226,834
Messages
6,193,215
Members
453,779
Latest member
C_Rules

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top