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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
beerygaz
Frequent Visitor

DATEDIFF doubles result

I have a strange situation using DATEDIFF to calculate seconds between two datettime fields.  I add a new column in my report called 'Duration':

 

Duration = DATEDIFF([Alert_Start],[Alert_Finish],SECOND)

 

Here's some sample data:

Alert_Start = 2017/08/27 00:25:22

Alert_Finish = 2017/08/27 00:25:25

 

However:

Result = 6 (I used my finders and worked out it really should be three seconds)

 

Where am I going wrong?

 

 

1 ACCEPTED SOLUTION
shill1000
Helper IV
Helper IV

The DAX is OK, are you sure it's not a data issue? Is it counting multiple records against the same index etc? Sample data will proabbly be more help here than anything else.

View solution in original post

2 REPLIES 2
shill1000
Helper IV
Helper IV

The DAX is OK, are you sure it's not a data issue? Is it counting multiple records against the same index etc? Sample data will proabbly be more help here than anything else.

Thanks for the hint, it seems I had duplicate rows in my database (although why these were being summarised is beyond me) but removing the duplicate rows solved my problem.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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