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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Raoom_A
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!
pic.png
 
1 ACCEPTED SOLUTION
grantsamborn
Solution Sage
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.

 

View solution in original post

6 REPLIES 6
grantsamborn
Solution Sage
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.

 

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

ppm1
Solution Sage
Solution Sage

Please try this expression.

 

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

Microsoft Employee

sorry it dose not work!

the result it pic pp.png

Greg_Deckler
Super User
Super User

@Raoom_A Try this:

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


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

do not work
Did not bring the expected output

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.