Look at the following description:
In 2002, the cost of an average house in the UK was around £130,000. By 2007, the average house price had risen to almost £190,000, but it fell back to just under £150,000 in 2008.
Notice the verbs used with "in" and "by":
- I used "in" with the past simple (was, fell).
- I used "by" with the past perfect (had risen) to give the idea that the increase had happened in the years leading up to 2007.
- To avoid worrying about "by + past perfect" you could write: "Between 2002 and 2007, the average house price rose to..."