Q:

SSRS: Calculating the average (mean) in a table missing values instead of zeros

I am trying to calculate the average of six machines in the following table.

The first column represents the machines, the second column is the good pieces and the third column is performance.
In the last row I want to calculate the average (the mean) of the rows but the result is not correct here. It should be 33,6%.
This is the expression I used:
=iif(AVG(Fields!Oee.Value)=0, "-", AVG(Fields!Oee.Value))

How can I calculate this without zeros?

A:

For the calculation you need to divide the sum of the column with the count of non zero rows
= SUM(Fields!Fields!Oee.Value)/ SUM(Iif(Fields!Fields!Oee.Value=0,0,1))

Also if you want to output something else for zero values you can use formatting eg. 0,0;-0,0;"-" (first part is for positive numbers, second for negative and third for zero)

