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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.