+ Reply to Thread
Results 1 to 4 of 4

Multiple Tables into 1 PivotTable

  1. #1
    Registered User
    Join Date
    10-07-2019
    Location
    Manitoba, Canada
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    32

    Multiple Tables into 1 PivotTable

    Hello,

    I am working on a spreadsheet that shows the total amount of donations made to each charity.

    I have 1 table with manually entered data from 2010-2014 (we weren't using an ERP at this point), and another table that is a Query from our ERP for 2015 forward.

    Both tables are identical in terms of format.

    The Query table can be refreshed with data pulled straight from our ERP. So when a new charity is added in our system, if i refresh that table it will add the Name | Year the donation was made | Amount, to the table and it will keep growing as needed.

    The 2010-2014 table has some of the same charities listed in the 2015-Present. On the reverse, the 2010-2014 table has charities listed that AREN'T in 2015-Present and vice versa.

    I need to create a "Master List/Summary" (either a PivotTable or regular table) of every charity we've ever give money to and the total amount (2010-2014+2015-Present)

    I want something that is totally automatic, if I refresh the Query, and a new charity appears, that new charity will get added to the "Master List/Summary".

    I'm trying to do it in a PivotTable but i cannot get it to show properly. The grouping is all messed up, see below.DonationHelp.JPG

    Completely out of ideas, if anyone has an idea how to do this using formulas instead of a PivotTable I'd be happy to hear that idea too.

    Attaching the spreadsheet but it's not great to work off of because i can't have my Query in the workbook so there won't be a refresh-able query table.
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Multiple Tables into 1 PivotTable

    I would suggest that you append one table to the other using Power Query. But first before doing that, your field names must be exactly the same. In your current example there is a space between the words and in the other there is not. This will cause issues so you will need to amend one of them. In the example that I created I joined them so that there is no space in the field names.

    Bring each table into PQ, Append one to the other. Pivot your data in PQ and close and Load to Excel. In your raw/source data, if you update your table and then click on Refresh All on the Data Tab, it will update your exported Pivot Table. I was not sure if you wanted to Pivot by year or by charity. I have supplied both.

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-07-2019
    Location
    Manitoba, Canada
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    32

    SOLVED: Multiple Tables into 1 PivotTable

    Hello, I hope you had a great Christmas and a Happy New Year!

    Thanks for pointing out that error in column names, i thought i made them match.

    I had never used PowerQuery before, this tool is amazing. After checking out those links, a few google searches and comparing my pivot table code to your pivot table code i managed to make it work perfectly even with the Query table from our ERP.

    Thanks so much, this was an incredible learning experience for me.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,888

    Re: Multiple Tables into 1 PivotTable

    if you wish to become better at PQ, suggest you purchase "M is for (Data) Monkey", a book by Ken Puls and Miguel Escobar.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Multiply and sum across multiple tables in PivotTable
    By excelandyou in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-06-2020, 12:04 AM
  2. Replies: 0
    Last Post: 12-04-2019, 12:10 PM
  3. Replies: 1
    Last Post: 12-01-2019, 01:13 PM
  4. Replies: 5
    Last Post: 12-04-2017, 10:33 AM
  5. Pivottable from multiple tables?
    By George.F in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-25-2017, 11:03 PM
  6. [SOLVED] Multiple Excel Tables In One PivotTable?
    By EnigmaMatter in forum Excel General
    Replies: 2
    Last Post: 01-29-2015, 09:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1