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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
borlip
Advocate I
Advocate I

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
Advocate I
Advocate I

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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