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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Difference between to date/time data type

Hello Power BI enthusiast,

 

I would like to calculate the time difference between two date/time data type. I have used the dax function of DATEDIFF as shown below but I think the precision is not correct

TimeDifference.pngTimeDifference2.jpg

 

When I checked using online calculator, I got the correct value of time difference . Is there any other way to write DAX in order to get the correct precision value ? 

Days between two days.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Try this dax.

Hi @Anonymous 

 

diff = DATEDIFF('Table'[Start Date],'Table'[End date],SECOND)
 
 
Date.PNG
 
Cheers,
Pravin Wattamwar

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

Hi @Anonymous 

try without .[Date]. it cut datetime to only Date

 = datediff(V_Incident[Created].[Date];V_Incident[Updated].[Date];SECOND)

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Try this dax.

Hi @Anonymous 

 

diff = DATEDIFF('Table'[Start Date],'Table'[End date],SECOND)
 
 
Date.PNG
 
Cheers,
Pravin Wattamwar

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors