LINQ Multi-Dimensional GroupBy

var transactions = new[] {
  new { Customer = "Andy", Amount = 28, Year = 2012, Month = "Jan" },
  new { Customer = "Bob", Amount = 101, Year = 2012, Month = "Jan" },
  new { Customer = "Claire", Amount = 28, Year = 2012, Month = "Feb" },
  new { Customer = "Andy", Amount = 28, Year = 2013, Month = "Jan" },
  new { Customer = "Claire", Amount = 28, Year = 2013, Month = "Jan" },
  new { Customer = "Claire", Amount = 73, Year = 2013, Month = "Feb" },
};

var res = transactions
  .GroupBy(t => new { t.Year, t.Month });

foreach (var g in res)
  Console.WriteLine("{0} => {1}", g.Key, g.Sum(t => t.Amount));

Outputs:
{ Year = 2012, Month = Jan } => 129
{ Year = 2012, Month = Feb } => 28
{ Year = 2013, Month = Jan } => 56
{ Year = 2013, Month = Feb } => 73