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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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