Forum Discussion

Johan Karlsson's avatar
Johan Karlsson
Copper Contributor
May 17, 2022

populate table with data from another table

Hi I have two different tables one is filled with data and the other one contains just headers. I want to extract data from the one with data and fill the other table with that data. But before I do that I need to transform the data in the first table by changing data types etc; for that purpose I Use power query but how do I when I want to fill the other table with data?

I added a screenshot as an example.

 

 

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    Johan Karlsson You don't explain what data should go to Table 2. How would one determine which rows from Table 1 qualify, based on the headers in Table 2?

     

    Or is it so that you want Table 2 only to show 6 out the 9 columns that are in Table 1? If so, in PQ, just remove the unwanted columns before you load the table back to Excel.

    • Johan Karlsson's avatar
      Johan Karlsson
      Copper Contributor
      Sorry if I was a little bit unclear but I'm aware that one of the solutions is just to remove columns in the first table. But this is just an example so I want to move the data from the columns in table 1 to their corresponding columns in table 2. As for the date columns in table 1 should go the xx_start and xx_end date columns in table 2.
      • Riny_van_Eekelen's avatar
        Riny_van_Eekelen
        Platinum Contributor

        Johan Karlsson So you have raw data and create the first table from it with PQ and you want a second table with only a selection of columns. Why not create another query referencing to the one that creates the first table and remove the unwanted column in that new query. Load it back to Excel as your second table.

Resources