To measure possession just check all of the time that your team had the ball compared to all the time that your opponents had the ball, and then change the numbers to a percentage. Primary school level arithmetic.
To measure expected goals you have to take the same shot from the same place 1,000...