Forum Discussion

Moliems's avatar
Moliems
Frequent Visitor
3 years ago
Solved

Max Date within a Group + extra condition

Hi there, could anyone help me in Power Query to pick the row for each student that has the max date below?   I have an extra issue that for some students there is more than one max date, so i woul...
  • AlienSx's avatar
    3 years ago

    Hi, Moliems 

    let
        Source = you_table,
        gr = 
            Table.Group(
                Source, "Name", 
                {"r", 
                each 
                    Table.FirstN(
                        Table.Sort(_, {{"Date", Order.Descending}, {"Status", Order.Ascending}}), 
                        1
                    )
                }
            ),
        z = Table.Combine(gr[r])
    in
        z