Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Taurus
Frequent Visitor

Table grouping with unknown quantity of columns

Hi all

 

I have this query:

Aggregation.png

 

I want to group by "Category" column and  aggregate (summ) all other columns (Column3, Column4 ... ColumnN), but the N (number of columns) is not known before (this columns appear after applying Table.Transpose)

 

I can see that grouping is like this

 

Table.Group(#"Prev step", {"Category"}, {{"Column3", each List.Sum([Column3]), type number}})

 

I want to use list of columns (got by Table.ColumnNames) instead "Column3" and use some kind of list instead of hard reference in List.Sum([Column3])

 

Is that possible? If not, what is trobleshooting?

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

before you start thinking about grouping your rows by the category column, unpivot the other columns:

https://www.youtube.com/watch?v=Kbu5RkUo6-k

 

Hopefully this provides you with some ideas.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey,

 

before you start thinking about grouping your rows by the category column, unpivot the other columns:

https://www.youtube.com/watch?v=Kbu5RkUo6-k

 

Hopefully this provides you with some ideas.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.