Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

How to append two tables when we have different column names?

Hello All, 

I have a columns like week18, week19, week20, week21, week22, underneath each column I have customer qty and buyer as sub column headers in table1, same way I have columns like week19, week20, week21, week22, week23 underneath each column I have customer qty and buyer as sub column headers in table2 as well, these files I will receive on weekly basis so column headers will keep moving forward to next WeekNo and so on. These files are stored in SharePoint folders. Requirement is that i want to append these tables and prepare a output report which includes those all week columns as single column as "week" And underneath wk-18, wk-19, wk-20, wk-21, wk-22, wk-23 to those corresponding customer qty and buyer values. I am facing challenge in handling week (date) columns as it's weekno keep moving forward and we end up getting to different weekno columns and not sure like which weekno belongs which value. Can you please help me to find a solution for this?

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You can demote headers on both files so that you are appending with names like Column1, Column2, etc.

     

    --Nate

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You might also consider unpivoting these columns before attaching them together.

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
    If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group