'Calculating time elapsed for each datapoint (Python, Excel, PowerQuery)

Help needed I am a beginner in data analytics. I have a dataset of a measuring device that measures weight(in kg) every minute.

E.g. dataset

Value         time
150kg      00:01:00
150kg      00:02:02
150kg      00:03:01
700kg      00:04:04
700kg      00:05:05
1100kg     00:06:07
1100kg     00:07:01

I need to calculate the total time elapsed when the weight was 150kg until it was 700kg. Calculate time for 700kg until its 1100kg and so on.

I managed to get the answer using python pandas and for loop. But I was wondering if there is a simple and better way to do this like in an Excel, Power Query or Power BI.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source