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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
borlip
Kudo Kingpin
Kudo Kingpin

Table.Group sum up dynamic columns

I have a pivoted table where each column represents revenue data by week starts. Week starts are column headers. There could be various number of columns.

 

I need to sum up each column (total revenue by week). I was thinking to use Table.Group

(table as table, key as any, aggregatedColumns as list, optional groupKind as nullable number, optional comparer as nullable function) as table

 

 

aggregatedColumns should be something like this: {{"1/7/2015", each List.Sum([1/7/2015]), type number}....

But how can I generate it on fly for a dynamic list of columns, as I don't know how many columns do I have?

1 REPLY 1
borlip
Kudo Kingpin
Kudo Kingpin

Got away without using Table.Group()... Unpivoted the table and grouped by dates to calculate sum of revenues per each date. Then pivoted the table by dates again...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.