You did not clearly ask a question. What part of this measurement is the problem?
I would probably consider an I/Q (in-phase and quadrature) measurement. Using complex arithmetic you should be able to separate the real part (resistive) from the imaginary part (reactive) to get what you want.
Lynn