score:1

Your query structure is:

from t in (
)
select new {
  Column1 = .Sum(p => p.TotalUserActions),        // here is the error
  Column2 = .Sum(p => p.AllTotalPoints),    // and here
}

You must use the t alias in result, like this:

from t in (
)
select new {
  Column1 = t.Sum(p => p.TotalUserActions),
  Column2 = t.Sum(p => p.AllTotalPoints),
}

But you must have such fields in your resulting query, which is not true right now.

I think you should write your query in SQL and transmit it to LINQ step by step. Right now it's very confusing and bug producing.


Update:
You've got the error because of your code doesn't contain such fileds. What should contain fields TotalUserActions and AllTotalPoints? Try to sum all Points fields, but can't say what the TotalUserActions is:

from t in (
)
select new {
  Column1 = t.Sum(p => p.TotalUserActions),
  Column2 = t.Sum(p => p.Points),
}

Related Articles