Take the motors rated hp, Say we are using a 10 hp single phase 230 volt unit.
Multiply the Hp by 746 (Watts to hp conversion)
Divide by .8 (Standard induction motor running efficiency is around 80%)
(10 x 746) / .8 = 9325 watts true power.
Take the measured voltage and multiply but the measured amps.
Say this motor has a 60 amp input rating at full load.
230 x 60 = 13800 VA
subtract true power from apparent power
13800 - 9325 = 4475
divide that by the line voltage 230 in this case.
4475 / 230 = 19.5
You would need a capacitive reactance of 4475 VA at 230 volts 60 cycles.