79558682

Date: 2025-04-06 20:04:48
Score: 0.5
Natty:
Report link
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.

enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: user22566114