Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    4 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,_))))