The {2} expression for the {0} '{1}' contains an aggregate function (or RunningValue or RowNumber functions) in the argument ...

The {2} expression for the {0} '{1}' contains an aggregate function (or RunningValue or RowNumber functions) in the argument to another aggregate function (or RunningValue).  Aggregate functions cannot be nested inside other aggregate functions.