+ Reply to Thread
Results 1 to 4 of 4

Changing Power Query rows to columns on repeat cells.

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Changing Power Query rows to columns on repeat cells.

    Using power query is it possible to turn a table that looks like this.

    Label 1 | Value 1
    Label 1 | Value 2
    Label 2 | Value 3
    Label 2 | Value 4
    Label 2 | Value 5

    into

    Label 1 | Value 1 | Value 2
    Label 2 | Value 3 | Value 4 | Value 5

    I was playing around with pivoting and transpose but couldnt figure it out.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Changing Power Query rows to columns on repeat cells.

    Assuming 1st column Header = A, 2nd column header = B

    Load table to PowerQuery.

    Group by [A], All Rows
    0.JPG

    Add custom column with formula:
    =Text.Combine([Temp][B], ",")

    Split column by delimiter ",".

    Remove column [Temp].

    Result:
    1.JPG
    ?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
    Registered User
    Join Date
    03-05-2011
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    84

    Re: Changing Power Query rows to columns on repeat cells.

    Quote Originally Posted by CK76 View Post
    Assuming 1st column Header = A, 2nd column header = B

    Load table to PowerQuery.

    Group by [A], All Rows
    Attachment 523210

    Add custom column with formula:
    =Text.Combine([Temp][B], ",")

    Split column by delimiter ",".

    Remove column [Temp].

    Result:
    Attachment 523211
    Whoa! i had no idea you could reference the table like that. That is very cool. Thanks for your help!

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,883

    Re: Changing Power Query rows to columns on repeat cells.

    You are welcome and thanks for the rep

+ 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. error in power query & power pivot
    By Baldev Kumar in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 01-03-2018, 01:34 AM
  2. Unpivot in Power Query keeping two columns
    By PennyK in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-10-2017, 06:27 AM
  3. Replies: 0
    Last Post: 10-25-2016, 02:59 AM
  4. How to remove null values from several columns with Power Query?
    By toblju in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2016, 11:08 AM
  5. Remove Unique rows in Power Query
    By danielmorrison in forum Excel General
    Replies: 2
    Last Post: 03-11-2016, 09:06 AM
  6. Replies: 2
    Last Post: 07-19-2015, 06:04 PM
  7. Replies: 2
    Last Post: 08-24-2005, 12:05 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