Forum Discussion
Mic1979
1 year agoPost Partisan
Group Based on Column Name
Hello all, I habe a table where I need to Table.Group function, and I would like to make it based on some character present in the column name. Here what I did so far. I defined the following...
- 1 year ago
Hello
thanks for your suggestions.
Finally, I found this solution:
Header = Table.ColumnNames (#"Removed Columns2"),
SelectDollarColumns = List.Select(Table.ColumnNames(#"Removed Columns2"), each Text.Contains(_, "$")),
HeadersToRemove = List.Combine ({{"PHASE IN TOTAL MATURE VOLUMES"},SelectDollarColumns}),
HeaderDifference = List.Difference (Header,HeadersToRemove),Grouped_Table = Table.Group (
#"Removed Columns2",
HeaderDifference,
List.Transform(
SelectDollarColumns,
(l)=> {l, each List.Sum(Table.Column(_, l)), type nullable number}
)
)