How to sum by group in Power Query Editor?

Viewed 2648

My table look like this :

Serial  WO#      Value   Indicator
A       333      10      333-1
A       333      4       333-2
B       456      5       456-1
A       334      1       334-1
A       334      5       334-2 

I want to create a new column that sums up the Values based on WO#. It should look like this:

Serial  WO#      Value   Indicator  SumValue
A       333      10      333-1      14
A       333      4       333-2      14
B       456      5       456-1      5 
A       334      1       334-1      6
A       334      5       334-2      6

Eventually I will remove duplicates on the WO# and remove the Value and Indicator Columns from the data. I can't seem to find a function in M that allows for sum by group. Thanks in advance!

1 Answers

If you load the data with Power Query, there is a Group command on the ribbon that will do just that.

Make sure to use the Advanced option and add all columns you want to retain to the grouping section. Screenshot from Excel ....

enter image description here

.... and from Power BI

enter image description here

Related