Forum Discussion
Anonymous
4 years agoNot applicable
Sum multiple Columns formula
Hello, I would like to sum mutliple columns in a table. For now, I simply did it like this: As the amount of columns might vary from time to time, I aim to make it more flexible. In all co...
- Anonymous4 years ago
Hi Anonymous
Can you promote the first row as header or you need the column names remain as Column1, Column2...? Here is one way if you promote the first row, my previous step is Change Type, you need to modify it accordingly
Table.AddColumn(yourPreviousStep, "Custom", (x) => List.Sum(List.Transform( List.Select( Table.ColumnNames( yourPreviousStep), each Text.Contains(_,"Capacity")), each Record.Field(x,_))))
Anonymous
4 years agoNot applicable
Hi Anonymous
Can you promote the first row as header or you need the column names remain as Column1, Column2...? Here is one way if you promote the first row, my previous step is Change Type, you need to modify it accordingly
Table.AddColumn(yourPreviousStep, "Custom", (x) => List.Sum(List.Transform( List.Select( Table.ColumnNames( yourPreviousStep), each Text.Contains(_,"Capacity")), each Record.Field(x,_))))
Anonymous
4 years agoNot applicable
It works like this, thank you very much!