+ Reply to Thread
Results 1 to 3 of 3

Merge columns in power query

  1. #1
    Forum Contributor
    Join Date
    10-08-2014
    Location
    Bengaluru, India
    MS-Off Ver
    O 365
    Posts
    141

    Merge columns in power query

    i have merged two tables in power query , my new table has employee name, emp id, work order number 1 , work order description 1, actual days, work order number 12 , work order description 12, Oct-23, Nov-23, Dec-23 plan.
    here my work order 1 and work order 12 both columns are same
    work order description 1 , work order description 12 columns are also same.
    I want to create a new table merge these data together and delete blank rows.
    In my sample sheet expected result is shown.
    I want to achieve this in power query or fully automated table in excel so that in the future weeks i can simply replace the data and refresh
    Attached Files Attached Files

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,913

    Re: Merge columns in power query

    I'd recommend including source data in the workbook. As is, it is difficult to see where you went wrong in your merge and append operation.
    As things are currently structured, you will need to split table into multiple and perform joins to get the result you are after.
    Ex:
    Use Table.SelectColumns to extract out Employee, Emp ID, Work order Number 1. Another to extract Employee, Emp ID, Work Order Number 12.
    Rename columns to be exact match and append queries and remove duplicates.
    Referencing starting table, drop every column after Days column, and filter out null. Then Group by and sum days.
    Do the same but this time drop Work order Number 1 to Days columns. Then Group by and sum Oct - Mar columns.

    Merge queries back into Append query.

    See attached.

    Though, this sort of transformation should be avoided in Power Query. You should load data to data model (using two fact tables, and dimension tables to relate them).
    Attached Files Attached Files
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Forum Contributor
    Join Date
    10-08-2014
    Location
    Bengaluru, India
    MS-Off Ver
    O 365
    Posts
    141

    Re: Merge columns in power query

    Thank you CK76

+ 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. [SOLVED] [Power Query] How to filter 0 from two columns in power query editor in one step?
    By daliye in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2023, 09:44 PM
  2. [SOLVED] Dynamically Unpivot without Power Query with Merge Columns and Rows
    By dluhut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-04-2023, 04:55 PM
  3. Power Query Dynamic Merge Columns
    By grcaz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-03-2022, 02:53 PM
  4. [SOLVED] Merge data in power query
    By Undo in forum Excel General
    Replies: 4
    Last Post: 08-19-2021, 05:42 AM
  5. [SOLVED] Merge Pro tip in Power Query
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2021, 03:53 AM
  6. Power Query Merge Columns if Not Null
    By brent_milne in forum Excel General
    Replies: 1
    Last Post: 01-26-2020, 11:41 AM
  7. Replies: 1
    Last Post: 03-12-2019, 04:42 PM

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