cancel
Showing results for
Did you mean:
New Member

## how can i calculate minutes between two times.

Hello

i would to ask how can i calculate minutes between two times.

here i try:

minnts = DATEDIFF('Table 1 (page)'[close],'Table 1 (page)'[open],MINUTE)
but there is problem in first rwo the result must be 10 min!

1 ACCEPTED SOLUTION
Solution Sage

Hi @Raoom_A

I'm unsure why you think your original measure didn't work.

Also, I'm unsure of how you can expect a result for the first 2 rows to both be equal to 10 minutes.

Out of curiosity, are your dates formatted as MM/DD/YYYY or DD/MM/YYYY ?    That would make a big difference.

6 REPLIES 6
Solution Sage

Hi @Raoom_A

I'm unsure why you think your original measure didn't work.

Also, I'm unsure of how you can expect a result for the first 2 rows to both be equal to 10 minutes.

Out of curiosity, are your dates formatted as MM/DD/YYYY or DD/MM/YYYY ?    That would make a big difference.

New Member

It is correct that I made a mistake in writing the date .. Thank you!

Solution Sage

= 24*60 - ('Table 1 (page)'[open] - INT('Table 1 (page)'[open]) - 'Table 1 (page)'[close] + INT('Table 1 (page)'[close]) )

Microsoft Employee
New Member

sorry it dose not work!

the result it pic

Super User

@Raoom_A Try this:

``Column = ([open] - TRUNC([open])) - ( [close] - TRUNC([close])) * 24 * 60``

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
New Member

do not work
Did not bring the expected output

Announcements

#### Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

#### Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors