You know that the distance PQ is 3.

The coordinates of P are (-1;0). Since PQ is parallel to the y axis, their x-ordinate are the same : -1.

And the distance PQ will be the difference between their y-ordinates.

So point Q has coordinates (-1;3)

Now, substitute them into y=ax˛ to get a.