doing two mysql requests in one
Depending on how many values you have for the 'foo' column, you may be able to accomplish this with a union:

select   foo, sum(position)/count(position) as average_position
from     (
    select   foo, position
    from     my_table
    where    foo = 'bar1'
    order by date desc limit 3
union all
    select   foo, position
    from     my_table
    where    foo = 'bar2'
    order by date desc limit 3
) as subquery
group by foo;