Skip to main content

Posts

Showing posts with the label #aggregatenonaggregateerror

Cannot mix aggregate and non-aggregate arguments with this function

Cannot mix aggregate and non-aggregate arguments with this function Resolution Each option can result in different values (please reference the attached workbook in the right-hand pane and additional information section for specific examples). Option 1 (Aggregate All Fields) Wrap all fields in an aggregation. Sample: [Profit] / SUM ([Sales]) -> SUM ([Profit]) / SUM ([Sales])   Option 2 ( De-aggregate All Fields) Remove aggregations from all of the fields. Sample: [Profit] / SUM ([Sales]) ->[Profit] / [Sales]   Option 3 ( De-aggregate All Fields Then Aggregate the Calculation.) Move the aggregation so the calculation is aggregated. For example, the calculation: IF [Row ID] = 1 THEN SUM( [Sales] ) END could become: SUM( IF [Row ID] = 1 THEN [Sales] END ) Option 4 (Use Level of Detail to De-aggregate a Field)  Use a Level of Detail (LOD) Expression to make an aggregation non-aggregate. All LOD expression return non-aggregated values....