Summing values across a row into a 'SUM' Column

Hi Everyone,

I am trying to add the values of multiple cells across a single row and have the result feed into a SUM column.

The data set looks something like:


In the actual dataset all months and years from 1980 to 2022 are filled out. This makes it quite messy, but it is an unfortuante requirment of the software package for the data to be imported this way.


Is there a way to achieve this?

So far, I have not had luck with aggregations or pivots; though I am likely to be missing something.


any help is much appreciated :slightly_smiling_face:

Hi Corey and welcome to the Community!

The sum column is basically an aggregate of multiple columns grouped by ID. So in this case, you need to:

  1. unpivot the table (keeping grouping by ID)
  2. keep only the values to aggregate
  3. sum them up (while grouped by ID)
  4. merge the sums back into the original table

See the sample project below.
column-sum.morph (4.9 KB)

Thanks dgudkov, that worked a treat!