Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I am trying to extrapolate the seconds between two dates using the function Duration.Seconds
Duration.Seconds([taglio_data_ora_fine]-[taglio_data_ora_inizio])
in some is correct in others not, how do I solve this problem?
Solved! Go to Solution.
Hi @ESS ,
I think you want to calculate the difference between two dates. You can try DATEDIFF() function in the DAX.
Column = DATEDIFF ( 'Table'[taglio_data_ora_fine], 'Table'[taglio_data_ora_inizio], SECOND )
Best Regards,
Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ESS ,
I think you want to calculate the difference between two dates. You can try DATEDIFF() function in the DAX.
Column = DATEDIFF ( 'Table'[taglio_data_ora_fine], 'Table'[taglio_data_ora_inizio], SECOND )
Best Regards,
Eads
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Duration.Seconds returns the duration of seconds between two 1-60 second stamps.
You see your first row thats displaying 54, there is 54 seconds between 57 and 51.
I think that you can get the correct duration if you subtract the two dates and then convert the value to seconds, (*24*60*60)
You can read more about the Duration functions here, but the short answer is that Duration.Seconds returns the seconds portion of any duration between two dates.
You'll likely want to use Duration.TotalSeconds([taglio_data_ora_fine]-[taglio_data_ora_inizio]) to get the total number of seconds between the timestamps.
Thank you Resident Rockstar.
This works great in the Power Query transform. 👍
Hi,
I'm not quite sure i understand, is it just the difference between seconds you're after? If so than the image you provided is showing the correct results.
Or are you after the total duration difference in seconds between two dates? If that is the case you should try and use Duration.TotalSeconds instead.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |