Search code examples
reporting-servicesssrs-2012

SSRS error - A scope is required for all aggregates Used outside of a data


I'm getting SSRS error - A scope is required for all aggregates Used outside of a data region unless the report contains exactly one data set.

I searched on google but still not figure out

= iif(((100/(DATEDIFF(MIN([initiative_Start_plan]),"InitiativeDatasettansiq"),
MAX([initiative_end_plan]),DAY))),"InitiativeDatasettansiq")
 *DATEDIFF(TODAY(),MIN([initiative_start_plan]),DAY)/100*-1)>1,1,
 (100/(DATEDIFF(MIN([initiative_start_plan]),"InitiativeDatasettansiq"),
 MAX([initiative_end_plan]),DAY)))
 *DATEDIFF(TODAY(),MIN([initiative_start_plan]),DAY)/100*-1), 
 "InitiativeDatasettansiq")

enter image description here

enter image description here


Solution

  • Your field references look incorrect. they should be something like

    MIN(Fields!initiative_Start_plan.Value)
    

    or

    MIN(Fields!initiative_Start_plan.Value, "myDataSetOrGroupName")
    

    The error is basically saying that you are using an expression outside of a data region and therefore you need to tell it where to get the data for each field from.

    If this does not help then you'll need to show more info. You will need to show where your expression is going to be used so please show your report design including the names of datasets and/or row/column groups (if any).