Forum Discussion
Bharani
7 years agoRegular Visitor
Find time duration between 2 dates (Datetime format)
Hi Experts - Am new to Power BI.. Hope u can crack my query in a min... I need to calculate "Number of minutes" between 2 dates which is in Datetime format..Below date is an example.. 3/11/20...
Johanno
7 years agoContinued Contributor
Nice! However, that won't work when the logtime and accepttime are on different days, months or years?
v-piga-msft
7 years agoResident Rockstar
Try this formula below.
Time =
VAR DIFF = 'CountMinutes'[accepttime] - 'CountMinutes'[logtime]
VAR NumOfMinutes = DIFF * 24
* 60
VAR DAYS =
IF ( DIFF >= 1, INT ( DIFF ), BLANK () )
VAR HOURS =
INT ( ( DIFF - DAYS ) * 24 )
VAR MINUTES = NumOfMinutes
- ( DAYS * 24
* 60 )
- ( HOURS * 60 )
RETURN
DAYS*24*60+HOURS*60+MINUTES
Here is the output.
Best Regards,
Cherry