Power Query: Sum values on duplicate dates

CascadeDiver

Board Regular
Joined
Apr 10, 2020
Messages
65
Office Version
  1. 2016
Platform
  1. Windows
I have a Power Query that has entries on duplicate dates. I am looking to sum all the values on duplicate dates.
In the example below I have Dates in the first column, Names across the next several columns, and the values that need to be summed within the table
Capture.PNG

The outcome would consist of date rows (only one row per date) and the all values summed and under their respective names. In this example there are only under the first two name column have multiple values within the dame date.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Forest", Int64.Type}, {"Riley", Int64.Type}, {"Janet", Int64.Type}, {"Jim", Int64.Type}, {"Beau", Int64.Type}, {"Michael", Int64.Type}, {"Aaron", Int64.Type}, {"Bryan", Int64.Type}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Date"}, "Attribute", "Value"),
    #"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Attribute]), "Attribute", "Value", List.Sum)
in
    #"Pivoted Column"

Book12
ABCDEFGHI
1DateForestRileyJanetJimBeauMichaelAaronBryan
210/5/2020552322
310/6/2020423
410/7/2020234
Sheet2
 
Upvote 0

Forum statistics

Threads
1,225,661
Messages
6,186,288
Members
453,348
Latest member
newbieBA

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top