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.
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.
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"
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks