Forum Discussion
Group Based on Column Name
- 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}
)
)
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}
)
)
Hi Mic1979,
I'm glad you found a solution and resloved the query. Thank you very much for sharing here.
Kindly mark your reply as the accepted solution so that others in the community can find it quickly.
Thankyou for connecting with Microsoft Community Forum.