0
votes

Sorry - I'm quite new to SSRS and floundering about.

I want to average some values over 3 years worth of data but I don't want to include 2020 in my average.

so currently the Value is [Avg(L3VAValueAdded)] - which works for all years - but includes 2020 but I need to be something like [Avg(L3VAValueAdded) where year <> 2020] or something like that?

1

1 Answers

0
votes

If you look at the actual expression that you currently have it will probably look something like this...

=AVG(Fields!L3VAValueAdded.Value)

An interesting feature of the AVG() function is that it does not include NULL values so we can use this to our advantage.

Change your expression to

=AVG(IIF(Fields!myYearField.Value) = 2020, Nothing, Fields!L3VAValueAdded.Value))

Obviously swap out the myYearField name for the correct field containing your year. This assume the "year" field is numeric, if it is a string then put 2020 in quotes.