Forum Discussion
Mr_Gou
Nov 15, 2023Copper Contributor
Power Query: Transpose part of a table
Suppose I have a table like this: +------------+---------+------------+-------------------------------------------------------+
| Category | Class | Function | Capability ...
- Nov 15, 2023
On reflection... Doable with the UI/Menus only. In attached file see extra step Added Custom after Grouped Rows (not altered this time)
Lorenzo
Nov 15, 2023Silver Contributor
On reflection... Doable with the UI/Menus only. In attached file see extra step Added Custom after Grouped Rows (not altered this time)
Mr_Gou
Nov 15, 2023Copper Contributor
Yes! You are the bee's knee, I wouldn't have found this on my own! Thank you!!!
- LorenzoNov 17, 2023Silver Contributor
Out of curiosity I looked at doing it without Indexing nor Pivoting. Best I could come up with so far:
// Alternative let Source = Excel.CurrentWorkbook(){[Name="Table"]}[Content], GroupedRowsOne = Table.Group(Source, {"Category", "Class", "Function"}, {"CAPABILITIES", each [Capability], type list}, GroupKind.Local // [Category], [Class] & [Function] ordered in Source table ), GroupedRowsTwo = Table.Group(GroupedRowsOne, {"Category", "Class"}, {"FUNCTIONS", each Table.FromColumns([CAPABILITIES],[Function]), type table}, GroupKind.Local ), ExpandedFunctions = Table.ExpandTableColumn(GroupedRowsTwo, "FUNCTIONS", List.Sort(List.Distinct(GroupedRowsOne[Function])) ) in ExpandedFunctions