Hi,
I am working on a project in Power Query and want to keep it dynamic and efficient. I have a custom function that I want to invoke on column1 (StartDate) and column2 (EndDate) to calculate duration between datetimes. Further, I want to invoke it on column2 (StartDate) and column3 (EndDate) etc. until the last column (StartDate), which I imagine would have to be paired with a fictional last+1 column of zeroes (EndDate).
The number of columns and their names will change from time to time, but the order will be as needed (column1, column2, column3 etc. to be calculated as described above).
I am looking to having this operation done as a single step, and ideally naming the new calculated columns the same as the starter column (so that the first calculation between the position column1 and position column2 will have the same name as column1 etc., either with an added "duration_" suffix or prefix, or having the new columns copied to a new query with identical names as the ones used for calculating the durations).
I am not sure if this is relatively easy to achieve or not, but I have attached an example workbook including one calculated column called "01_duration".
Best regards,
Marbleking
Bookmarks