Forum Discussion

ajl_ahmed's avatar
ajl_ahmed
Iron Contributor
Aug 20, 2022

Appending data using power query

how to append data of a specific sheet of a workbook to worksheet of another workbook using power query such that the existing data in the sheet not deleted? i am using office 365 latest version and MACbook.

14 Replies

  • You can use PowerQuery within a single workbook if you want to. Add a new worksheet then use the Data Tab and click PowerQuery. Use the Excel connector and choose the file that you currently have open.
  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    ajl_ahmed I would take a new workbook and connect to the relevant sheet in each of the workbooks by using the "Excel workbook" connector. Then you can append one query to the other. Close and Load and you'll end up with one single table, leaving the two original files untouched.

     

    By the way, I assume you are on the Insider Beta channel. 

     

    • ajl_ahmed's avatar
      ajl_ahmed
      Iron Contributor
      Thx. For your reply
      Does this method work if I make many copies of workbooks and want to send the data of specific sheet into a master workbook? I mean that can I make this method as a property of workbook such that it work even I make copy of workbook.?
      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        ajl_ahmed Perhaps I don't understand the question but PQ doesn't "send" data into a master sheet. The process that I described creates a table in a new workbook (you may call that "the Master") and is connected to the underlying original files. If these files change (without renaming the file name and the sheet name) the Master will automatically pick-up the new data upon a refresh of the connection.

        Once you have set this up correctly, you could make it dynamic by including some variables that allow you to write the full file paths and file names in the "master" and have the query connect to and append those two files.

Resources