Forum Discussion
Anonymous
3 years agoNot applicable
Custom list sorting for duplicate values
Hi all, For example, I have this data from a review process: ID Rating 57795 A 57795 Pass 57795 Pass 57795 A What I want to do is have a single result returned for I...
JohnShepherdAPD
3 years agoHelper II
Hi this example should give you what you want, however, if you want a different order of ratings then add an integer column for every rating and group by that
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjU3tzRV0lFyVIrVQfACEouL8QtA1RsbGZoAeU4oPLfEzByl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Rating = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Rating", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"ID"}, {{"Rating", each List.Min([Rating]), type nullable text}})
in
#"Grouped Rows"
Anonymous
3 years agoNot applicable
Thanks for this - looks good, although I'll need to look at the code so I can understand it myself (it's really appreciated that you've provided this, I just need to understand it so I can apply it to similar situations in future!).