I am trying to create a summary table of data located in a couple hundred CSV files. I have created some power queries to convert the data into one table with five columns (Name_Age, Events, MS, Name, Age) and import it into a table in Excel. This table is called RawData.
In a second tab, I have a VBA script copying RawData into a second table called Prep. The second table is necessary because I have a sixth column that calculates Duration. This second table is necessary because I couldn't figure out how to do the calculations in Power Query.
So, MS stands for milliseconds. This field represents the moment in time that Event happens. I need to calculate the duration of the event, i.e. MS of next event - MS of the current event. Using the Event AR as an example, my formula takes the MS of F (32635) and subtracts the MS of AR (32301) to give a duration of 334. ER stands for End of Record or the end of the timeline in question for the subject. How can I do that in Power Query?
I can do it in Excel but I am using a macro to copy RawData into Prep. I would prefer to just have it all done in Power Query. The other reason is I then have a PivotTable summarizing the whole thing. If I can get the Duration calculated in Power Query, I can skip the macro.