Power Query M code
let
Source = YourTable,
Grouped = Table.Group(Source, {"GroupColumn"}, {{"AllRows", each Table.AddIndexColumn(Table.Sort(_, {{"Value", Order.Descending}}), "Rank", 1, 1, Int64.Type), type table}}),
Expanded = Table.ExpandTableColumn(Grouped, "AllRows", Table.ColumnNames(Source) & {"Rank"})
in
Expanded