I have a doubt and would require a small support on Python.
- I wish to calculate the difference of Last value of Current month - Last value of Previous month ( this is tag wise)
- Then, the total sum of value calculated from number 1. against per month for all tags.
In the dataset, there are multiple values for December 31, and Jan1, Jan2.. Jan 30. Now I want to calculate as, Result = Last or Latest value of Jan 30(among multiple values) - Last value of the Previous month (Dec31)
The expected output looks like this:
I'm taking the reference from the powerBI table were calculation is already done. I want the same to be done using python.
Case 1: Calculate the difference of Last value of Current month - Last value of Previous month ( as seen from the last column in table( Diff Value of CM - PM). Please have a look to see how the difference is taken.
Case 2:
Total Summation of the values (Diff value of CM - PM from Case1) for all the tags against each month and year.
Case 1 & 2 are connected. Case 1 is the sum of values per tag, and Case 2 is the total sum of values for all the tags.
Sample data can be accessed from here: Dataset
Please support me on this ?