Q:

Group by year descending, order by month and total on another column Linq query

Have this Linq query almost working, can't figure out how to do the descending order. Here is what I have so far:
list.GroupBy(grp => grp.year)
    .SelectMany(g => g.OrderBy(grp => grp.month))
    .ToList();

Which produces the following results:

Month is in the correct order except the year needs to be in descending order. Like this:

This might be too much to ask but also need to run a total of days per grouped year. Really appreciate any help!
The data looks like this:

The answer the worked for me was this:
list.OrderByDescending(grp => grp.year).ThenBy(grp => grp.month).ToList()

A:

Two comments:

You are "grouping" your data, then turning around and un-grouping via a SelectMany, which effectively throws away any grouping; it just puts the data into groups, but not in any configurable order.  Just select all of your data in one go, ordering by year descending, then month:
list.OrderByDescending(l => l.year)
    .ThenBy(l => l.month));

Adding "group footers" to show subtotals is the job of the presentation layer, not the data layer.  You could create a hybrid list that inserts a total "row" into your data, but it is probably more straightforward to add a group footer by configuring whatever control is presenting the data rather than inserting subtotals into the raw data.

