Forum Discussion
Anonymous
6 years agoNot applicable
Combining value of rows keeping all columns
Hi all, I have some data where I have some of the rows repeating many times but with a different numerical value (quantity), where I would simply like to combine it into one unique row per unique...
- 6 years ago
A 'Group By' solves this. Select multiple columns before clicking 'Group By'
Am I missing something?
- 6 years ago
Hi Anonymous ,
They both are right. I just add an image and relative code.
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCg1W0lHySy1XiMwvygYyg/NLSzKAtGticQmQMjQwUIrVIajMFEmVU35xSX4eSHl+EVhNeCpYjRHUKOfEvMSURKBAWGJecn5pWWoRplpjEtSa4FGK7hsjNLW++XklRamJOUhKoaYagoyNBQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Country = _t, City = _t, #"N/S" = _t, #"W/E" = _t, Sales = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Country", type text}, {"City", type text}, {"N/S", type text}, {"W/E", type text}, {"Sales", Int64.Type}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Country", "City", "N/S", "W/E"}, {{"Sum", each List.Sum([Sales]), type nullable number}}) in #"Grouped Rows" - 5 years ago
Group By Order Number and Purchase Number
and use aggregations on: Sum of Quantity and Max of Date
HotChilli
Community Champion
5 years agoGroup By Order Number and Purchase Number
and use aggregations on: Sum of Quantity and Max of Date
Anonymous
5 years agoNot applicable
This works great, thank you!