none
Merge Rows in Power Query RRS feed

  • Question

  • Hi All,

    I have an excel table like this,

    Name, Date1, Date2, Date3, Date...

    John, null, 3, null, null, 

    John, 1, null, null, null

    John, null, null, 4, null

    John, 3, null, null, null

    What I would like to do is merge the rows with a sum so I end up with

    Name, Date1, Date2, Date3, Date...

    John, 4, 3, 4, null, null

    Any help most appreciated.

    Thanks

    Alex

    Friday, September 4, 2015 1:31 PM

Answers

All replies

  • Ah solved it using Pivot. 

    Thanks for anyone who looked.

    Friday, September 4, 2015 1:41 PM
  • You could also have solved it in PQ with a Group by statement. Select column "Name", then right-click, then "Goup  By...". 

    = Table.Group(#"Replaced Value", {"Name"}, {{"SumDate1", each List.Sum([Date1]), type anynonnull}, {"SumDate2", each List.Sum([#" Date2"]), type anynonnull}, {"SumDate3", each List.Sum([#" Date3"]), type anynonnull}})

    Monday, September 14, 2015 5:20 PM