First of all, you need to decide what a null value should mean to you: 0 or need to be skipped:
avg(null,1,2)==1
or
==1.5
In the first case you can use
COALESCE[
^], like this:
SELECT avg(COALESCE(planned,0))as Planned,avg(COALESCE(achieved,0)) as Achieved...
In the second case you can filter selection with
... WHERE planned is not null
but this way you can calculate only one average per select. But this is no actual problem in a stored procedure.