Forum Discussion
tbhatia
4 years agoMicrosoft Employee
Unique ID's from Data Set
We are preparing a dashboard on RPA data. We have 2 columns. First has unique work ID's. The other column has names, BOT and Humans. These ID'S in the data set have been worked by both humans and BOT...
Anonymous
4 years agoNot applicable
Hi tbhatia ,
You can try to deduplicate the names by grouping by ID, and keep the ones greater than 2.
The complete M language is as follows
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwMFTSUXLyD1GK1YFzPUpzE/OKYSJGGCLGMC2xAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"ID's" = _t, names = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID's", Int64.Type}, {"names", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"ID's"}, {{"Count", each _, type table [#"ID's"=nullable number, names=nullable text]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.RowCount(Table.Distinct([Count]))),
#"Expanded Count" = Table.ExpandTableColumn(#"Added Custom", "Count", {"names"}, {"names"})
in
#"Expanded Count"
Initial data
1.Group by and select all rows.
2.Add a custom column.
3.Expand the column and filter out rows with custom column value equal to 2.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.