Creating a sensor based on the delta of two other sensors to estimate efficiency?

I have two sensor values that should be updating at the same time.

  1. Cumulative km / odometer reading.
  2. The % of charge remaining. (I know that 100% is approx. 106-110kWh)

I would basically like a 3rd sensor that shows the estimated km/kWh

How would I go about figuring out the deltas for both those sensors so I could figure out the distance and % change since the last reading?