Forum

sum of column using...
 
Notifications
Clear all

sum of column using its order powerquery

2 Posts
2 Users
0 Reactions
79 Views
(@jiri-h)
Posts: 2
New Member
Topic starter
 

I have a silly question - I need tu sum last 12 columns from 20 to make Moving Annual Total and I need to do it in power query. But headers of that columns are changing - they contains month names. So I found something, but i cannot make it work - here is syntax I need to correct from you:

= Table.AddColumn(Source, "MAT", each List.Sum({ Table.ColumnNames(Source){1}, Table.ColumnNames(Source){2}}), type number)
Thank you very much in andvance to helping me with my problem :-). Jiri
 
Posted : 03/06/2021 2:12 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Jiri,

Your data is in the wrong format. You should never have the columns represent a separate month. This data needs to be unpivoted. From there you can create a PivotTable with your moving annual total.

Mynda

 
Posted : 03/06/2021 3:56 am
Share: