Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I have a table with the following colluns:
Date | Hour | OperationCode | ID
Whenever I have a change in a operation, a new line is created with the record of the hour that operation started.
I need to create a new collum with the "Operation Duration". Being so, it will always be the Hour of the next line - the Hour of current line.
Any idea on how can i do it in Power Query?
Solved! Go to Solution.
you can try this
Proud to be a Super User!
could you pls provide some sample data and expected output?
Proud to be a Super User!
Sure!
02/08/2024 | 13:50 | Navigation | 1
02/08/2024 | 23:30 | Mooring | 2
03/09/2024 | 01:00 | Moored | 3
I expect to get the personalized collum as the following
02/08/2024 | 13:50 | Navigation | 1 | 580 minutes
02/08/2024 | 23:30 | Mooring | 2 | 90 minutes
03/09/2024 | 01:00 | Moored | 3 | ...
how you get 580 mins and 90 mins?
Proud to be a Super User!
02/08/2024 | 13:50 | Navigation | 1 | 580 minutes (23:30 - 13:50 = 09:40 => 09*60 + 40)
02/08/2024 | 23:30 | Mooring | 2 | 15 minutes (23:45 - 23:30 = 15)
02/08/2024 | 23:45 | Moored | 3 | ...
I've changed the last value because it gets a little bit more complicated when day changes.
you can try this
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!