How to calculate average headcount of a company using Kibana visual builder 6.7?

Hi,

I am looking to calculate Average Headcount of a company using Kibana Metric Visual Builder. The formula is:
Avg HC= (Opening HC + Closing HC) /2
where HC= Headcount;

But my index data is coming from 2 CSV files- one is having data of active employees and other is having attrition data.

To calculate avg HC, I need opening HC and closing HC but I am stuck. Please help me to know how can I calculate Opening HC and Closing HC.

Thanks in Advance!

Regards,
Sonam

Any Update on this??