let
Source = Excel.CurrentWorkbook(){[Name="Tabelle1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Client", type text}, {"ID", Int64.Type}, {"Value", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Client"}, {{"Max ID", each List.Max([ID]), type number}}),
#"Merged Queries" = Table.NestedJoin(#"Grouped Rows",{"Client", "Max ID"},#"Source",{"Client", "ID"},"Source",JoinKind.LeftOuter),
#"Expanded {0}" = Table.ExpandTableColumn(#"Merged Queries", "Source", {"Value"}, {"Value"}),
#"Grouped Rows1" = Table.Group(#"Expanded {0}", {"Client", "Max ID"}, {{"Max Value", each List.Max([Value]), type number}})
in
#"Grouped Rows1"
Another alternative could be Power Query when you apply the above M code. The name of the blue dynamic table in my example is Tabelle1.