cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
magus
Helper I
Helper I

Difference between two times

Hello!

I am trying to calculate a waiting time between the moment that the customer opens a claim and an agent resolves it. In other words, it is a difference between two times in Power Bi. I tried to used DATEDIFF formula, but my both columns are in Time format: HH:MM:SS, not DateTime format, so it is not working correctly.

Any ideas how can I calculate it?

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @magus ,

Basically the datediff() function should work when the date format is HH:MM:SS.

You can also create a calculated column like this to calculated the minutes diff:

Basic calculation column = 
VAR diff = [Resolution hour] - [Claim submition hour]
RETURN
    HOUR ( diff ) * 60
        + MINUTE ( diff )
        + SECOND ( diff ) / 60

diff.png

Attached a sample file in the below, hopes it could help.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yingjl
Community Support
Community Support

Hi @magus ,

Basically the datediff() function should work when the date format is HH:MM:SS.

You can also create a calculated column like this to calculated the minutes diff:

Basic calculation column = 
VAR diff = [Resolution hour] - [Claim submition hour]
RETURN
    HOUR ( diff ) * 60
        + MINUTE ( diff )
        + SECOND ( diff ) / 60

diff.png

Attached a sample file in the below, hopes it could help.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

magus
Helper I
Helper I

Hello! I would like to get a new column with waiting time in minutes (difference between Hour of claim submition - hour of resolution). Like this: Waiting time.PNG

The example that I show is a result I got in other Query, but in that query I had Source Data with DateTime format. The formula was like below:

Waiting Time = DATEDIFF('Source Data'[Claim submition hour], 'Source Data'[Resolution hour], MINUTE)
vanessafvg
Super User I
Super User I

Can you give some examples of the result you are expecting.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hello! I would like to get a new column with waiting time in minutes (difference between Hour of claim submition - hour of resolution). Like this: Waiting time.PNG

 

The example that I show is a result I got in other Query, but in that query I had Source Data with DateTime format. The formula was like below:

Waiting Time = DATEDIFF('Source Data'[Claim submition hour], 'Source Data'[Resolution hour], MINUTE)

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors