Forum Discussion
rhenus-florian
3 years agoNew Member
Dynamic Table.Group with dynamic amount of Columns
Hello, First, I want to excuse my bad English, nevertheless i hope you can understand my problem. I want to group with sum agregation several columns of a table - with the Table.Group function....
- 3 years ago
=Table.Group(Table1,"RepeatGroup",List.Transform(List1,each {_,(x)=>List.Sum(Table.Column(x,_))}))
Anonymous
3 years agoNot applicable
Hi rhenus-florian - thank you for your question. I could follow what you are asking.
I would like to suggest using the Unpivot Other Columns feature in Power BI before Grouping. The approach will lead to Group By including "RepeatGroup, Attribute, Value". Table.UnpivotOtherColumns - PowerQuery M | Microsoft Learn. The Attribute column will dynamically change for the new columns.
After using Group By, you can alway Pivot back to have the columns, but this may not be necessary.