Here is one way (but probably not the most elegant one):
ds[All, <|"x" -> #x, "y" -> #y - ds[Max, "y"]|> &]
My suspicion is that this not very effective, because this way ds[Max, "y"]
seems to be evaluated again and again, as this does suggest so (using nn
as a counter):
nn = 0;
ds[All, <|"x" -> #x, "y" -> #y - (nn++; ds[Max, "y"])|> &];
nn
(* Out: 5 *)