Forum Discussion

mlsx4's avatar
mlsx4
Memorable Member
2 years ago
Solved

Help with Group By

Hello everyone.   Let's say I have a table like this, where I need to remove all rows related with workers which doesn't have any True value in status. How can I achieve this behaviour? W...
  • AlienSx's avatar
    2 years ago

    Hello, mlsx4 

    let
        Source = your_table_like_this,
        group = Table.Group(Source, "Worker ID", {{"wid", each _}}), 
        select = Table.SelectRows(group, (x) => List.AnyTrue(x[wid][Status])),
        expand = Table.ExpandTableColumn(select, "wid", {"Column1", "Column2", "Status"})
    in
        expand