+ Reply to Thread
Results 1 to 3 of 3

Transpose List in power query

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-25-2021
    Location
    Atlanta, Georgia
    MS-Off Ver
    365
    Posts
    144

    Transpose List in power query

    Is there a way in Power Query to transform a list to layout vertically?

    Column A are Agencies. Column B are sites they manage.
    I would like the Agency's name to be headers and each site to be listed under its respective agency.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,429

    Re: Transpose List in power query

    Code
    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        #"Grouped Rows" = Table.Group(Source, {"Agency"}, {{"Count", each Table.Skip(Table.Transpose(_), 1)}}),
        #"Expanded Count" = Table.ExpandTableColumn(#"Grouped Rows", "Count", {"Column1", "Column2", "Column3", "Column4", "Column5", "Column6", "Column7", "Column8", "Column9", "Column10", "Column11", "Column12", "Column13", "Column14"}, {"Count.Column1", "Count.Column2", "Count.Column3", "Count.Column4", "Count.Column5", "Count.Column6", "Count.Column7", "Count.Column8", "Count.Column9", "Count.Column10", "Count.Column11", "Count.Column12", "Count.Column13", "Count.Column14"}),
        #"Transposed Table" = Table.Transpose(#"Expanded Count"),
        #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
        #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Envision", type text}, {"A LENDING HAND PERSONAL CARE HOME,", type text}, {"A PLACE OF SERENITY,INC", type text}, {"A PLACE OF SERENITY,INC.", type text}, {"ABC HEALTHCARE OF AMERICA, LLC", type text}, {"ABILITIES DISCOVERED, INC.", type text}})
    in
        #"Changed Type"
    Attached Files Attached Files

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Transpose List in power query

    Please try

    let
        Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
        Grouped = Table.Group(Source, {"Agency"}, {{"T", each ([Site Name])}}),
        FromCol = Table.FromColumns(Grouped[T],Grouped[Agency])
    in
        FromCol
    Attached Files Attached Files

+ 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. Power Query - Transpose Specific Columns
    By keith6292 in forum Excel General
    Replies: 1
    Last Post: 07-20-2021, 04:01 PM
  2. [SOLVED] Transpose values Power Query
    By JyothiGrace in forum Excel General
    Replies: 2
    Last Post: 07-19-2021, 08:48 AM
  3. Replies: 8
    Last Post: 10-21-2020, 03:02 AM
  4. [SOLVED] Transpose from columns to rows with Power Query
    By lofgren in forum Excel General
    Replies: 9
    Last Post: 06-21-2020, 10:56 AM
  5. [SOLVED] Power Query - excel formula translation into Power Query
    By afgi in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-19-2020, 03:38 AM
  6. Replies: 4
    Last Post: 02-17-2020, 06:03 AM
  7. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM

Tags for this Thread

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