Try using CASE as follows
SELECT CASE WHEN SUM(Exit) IS NULL THEN NULL ELSE AVG(Exit) END AS MyAverage FROM MyTable
I think the problem is with the column name. Just change the column name to ExitCol and check.
In this case, even SELECT AVG(ExitCol) AS MyAverage FROM MyTable will also work
source share