The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi I have a two datetime columns (starttime and endtime)
I would like a measure that calculate the duration in minutes between 08:00 -16:00
Example
Startime: 1-1-2021 06:35 and endtime: 1-1-2021 15:00 -> result: 420
Startime: 1-1-2021 01:35 and endtime: 1-1-2021 7:33 -> result: 0
Solved! Go to Solution.
@iseni ,
new column =
var _start =if(hour([Start_time]) <= 8 , date(year([Start_time]), Month([Start_time]),day([Start_time])) +time(8,0,0) , [Start_Time])
var _end =if(hour([end_time]) >= 16 , date(year([end_time]), Month([end_time]),day([end_time])) +time(16,0,0) , [end_time])
var _diff =diff(_start,_end, minute)
return if(_diff <0, 0, _diff)
Thanks works perfect 🙂
@iseni ,
new column =
var _start =if(hour([Start_time]) <= 8 , date(year([Start_time]), Month([Start_time]),day([Start_time])) +time(8,0,0) , [Start_Time])
var _end =if(hour([end_time]) >= 16 , date(year([end_time]), Month([end_time]),day([end_time])) +time(16,0,0) , [end_time])
var _diff =diff(_start,_end, minute)
return if(_diff <0, 0, _diff)
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
102 | |
82 | |
62 | |
56 |
User | Count |
---|---|
254 | |
119 | |
115 | |
99 | |
71 |