Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How do I copy columns from multiple sheets into a new sheet?

Hello,

 

I'm trying to figure out how to do something that seems relatively simple, but I can't figure it out. I have two Excel sheets that contain my source data, and I'd like to use Power BI to copy a couple columns from each of the sheets into a new table in which I can perform manipulations. 

 

Here are examples of my source tables:

 

Source Table 1

 

 

 

 

 

Source Table 2

 

 

 

 

 

Output Table:

Copy columns 1-2 in table 1 and columns A-B in table 2 into output table. 

 

 

 

 

 

 

 

The goal is to make it so that whenever updates are made to the source sheet, all I have to do is refresh Power BI to see my changes reflected in the new table. 

 

Thanks in advance for your help!! 

  • Anonymous's avatar
    Anonymous
    6 years ago

    Anonymous  - Is there any relationship between the 2 sheets? If it's simply mapping the same row on each sheet, you could do the following in Power Query:

    1. Import both tables
    2. Add an Index column to both tables
    3. Merge one table into the other, joining on the Index columns.
    4. Expand columns.
    5. Remove any unnecessary columns
    I hope this helps. If it does, please Mark as a solution.
    I also appreciate Kudos.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous  - Is there any relationship between the 2 sheets? If it's simply mapping the same row on each sheet, you could do the following in Power Query:

    1. Import both tables
    2. Add an Index column to both tables
    3. Merge one table into the other, joining on the Index columns.
    4. Expand columns.
    5. Remove any unnecessary columns
    I hope this helps. If it does, please Mark as a solution.
    I also appreciate Kudos.
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks a ton, worked like a charm!