public class Table
{
public string ID { get; set; }
public string X { get; set; }
public string Y { get; set; }
public int P { get; set; }
}
List<Table> table = new List<Table>() {
new Table() { ID = "03", X = "Str1", Y = "C1", P = 10 },
new Table() { ID = "04", X = "Str1", Y = "C1", P = 5 },
new Table() { ID = "05", X = "Str1", Y = "C1", P = 1 },
new Table() { ID = "06", X = "Str1", Y = "C1", P = 2 },
new Table() { ID = "07", X = "Str2", Y = "C1", P = 25 },
new Table() { ID = "08", X = "Str2", Y = "C1", P = 4 },
new Table() { ID = "09", X = "Str1", Y = "C2", P = 411 },
new Table() { ID = "10", X = "Str1", Y = "C2", P = 2356 },
new Table() { ID = "11", X = "Str2", Y = "C2", P = 12 },
new Table() { ID = "12", X = "Str2", Y = "C2", P = 33 },
};
var ret = table.GroupBy(p => new { p.X, p.Y }).Select(i => new { Table = new Table() { X = i.Key.X, Y = i.Key.Y, P = i.Max(o => o.P) }, Items = i.Select(f => f) }).ToList();
ret.ForEach(c => c.Table.ID = c.Items.First(i => i.P == c.Table.P).ID);
var finalResult = ret.Select(x => x.Table).ToList();