Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
daniel_hob
New Member

Gap between two durations

Hi everyone, 
I am trying to calculate gap (difference) between two durations:

Duration beween actual working time of the employees and the time they spend/stay in the workplace,
For calculating the effectiveness of the workday.

it's not like calculate difference between date.
New Bitmap Image.jpg

I really appreciate any help.
Thank you,
Best Regards
1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

It is much easier to deal with durations as decimal numbers, and then display the result in your desired format at the end. Please see this article.

Calculate and Format Durations in DAX – Hoosier BI

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

It is much easier to deal with durations as decimal numbers, and then display the result in your desired format at the end. Please see this article.

Calculate and Format Durations in DAX – Hoosier BI

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


serpiva64
Solution Sage
Solution Sage

Hi,

you can use a calculated column

Column = format(VALUE('Table'[Column2])-VALUE('Table'[Column1]),"hh:nn:ss")
or a measure
Column = format(VALUE('Table'[Column2])-VALUE('Table'[Column1]),"hh:nn:ss")
 

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.