Forum Discussion
How can I group like rows ?
- 1 year ago
I decided on making a clone of the table and just having "removed" in there and merge it back and filter out those records with Key as null, it appears to work and needed to have this due to time sensitivity, but thanks all for your assitance and ideas.
The code does not use GroupBy (and executes considerably faster). If you wanted to do it from the UI,
1. when your table is showing, select the down arrow in the NAME column, and de-select "Removed"
2. In the formula bar you will see something similar to below. "Source" will be the same as your previous step.
3. Replace what you see after the first comma with:
(r)=>
let
allKeys = Table.SelectRows(Source, each [KEY] = r[KEY])
in
not List.Contains(allKeys[NAME],"Removed",Comparer.OrdinalIgnoreCase))
resulting in:
When I filtered out "Removed", I have this line:
#"Filtered Rows2" = Table.SelectRows(#"Added Custom4", each ([NAME] = "Added"))
However, I still see "DATA-123" as Added in the table, the point is if DATA-123(or any other record) has both "Added" and "Removed" to remove both rows.