Trying to calculate the average of nonzero rows in a column in an RDLC

Is there a way to program the average of non-zero rows only for a column of data in a table in an RDLC to view Microsoft reports?

those. 0 0 0 5 5 = 5 not 2

I tried Count (fields.n.value> 0) to get the number of nonzero rows, but it returned the number of all rows.

Thanks!

Eric -

+4
source share
1 answer

Try the following:

=Sum(Fields!n.Value > 0) / Sum(IIf(Fields!n.Value > 0, 1, 0)) 

Notice how the average is calculated manually by summing all the values, then dividing by another amount, which mimics a specialized calculation mechanism.

+6
source

Source: https://habr.com/ru/post/1310776/


All Articles