Remove the else part from the case statement , so values less than 1 will be NULL .
Values
NULL will be fixed using Avg aggregate . This way you get an average value that is greater than 0 . Try it.
Select Avg(Case when [Column]>0 then [Column] end) as [Avg]
Demo
No else part in case statement (expected average)
SELECT Avg(CASE WHEN a > 0 THEN a END) [Avg] FROM (SELECT 2 a UNION ALL SELECT 2 UNION ALL SELECT -1) bb
Result: 2
With the else part in the case statement .
SELECT Avg(CASE WHEN a > 0 THEN a ELSE 0 END) [Avg] FROM (SELECT 2 a UNION ALL SELECT 2 UNION ALL SELECT -1) bb
Result: 1
source share