The {2} expression for the {0} {1}' uses the function Aggregate with an invalid scope parameter. The scope parameter must ...

The {2} expression for the {0} ‘{1}' uses the function Aggregate with an invalid scope parameter.  The scope parameter must be the name of a scope where all containing grouping scopes have group expressions that are simple field references or constants.