1

In SSRS reports I have created this calculated fields to calculate or return sales of Bike WRT to the previous year but it ends up showing error:-

The expression used for the calculated field 'CompareSales' includes an Aggregate, RowNumber, Running Value, Previous or lookup function.

Aggregate, RowNumber, RunningValue, Previous and lookup functions cannot be used in calculated field expressions.

I have tried every possibility to avoid error.

This is my piece of code:

=SUM(iif(Fields!Year_1.Value=MAX(Fields!Year_1.Value),Fields!BikeBuyer.Value,0))
-SUM(iif(Fields!Year_1.Value=MAX(Fields!Year_1.Value)-1,Fields!BikeBuyer.Value,0))
/SUM(iif(Fields!Year_1.Value=MAX(Fields!Year_1.Value)-1,Fields!BikeBuyer.Value,0))

When I remove SUM() from my code it executes successfully, but it won't produce the proper output.

Please Suggest me what I can do!!!

Thank You in Advance

MiguelH
  • 1,415
  • 1
  • 18
  • 32
Yash Sonar
  • 13
  • 5
  • An alternative is to do the aggregates/running values etc in SQL as extra columns and use the SQL values rather than rely on SSRS. – MiguelH Mar 13 '18 at 11:23
  • Thanks for that alternative suggestions. But I also tried this alternative but end up showing warning that "Can't aggregate date Vale with numeric value!!!!" – Yash Sonar Mar 13 '18 at 23:52

0 Answers0