Fix jumps in average value calculation due to range switches

Use a different tick for average value calculation that only updates
if the average value sum was also updated.