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.
Hey guys.
i have the straight distance between two coordinates and i'd like to calculate, with a average speed of 80km/h, the travel time between them.
the problem is that some routes take more than 24h to be completed and then i stumble on the 'hour' formatting, that keeps me from getting the 'duration' correctly.
for example:
my current travel time formula: travel = TABLE[distance]/80/24
so, 2000(distance)/80(avg km/h)/24(turn into a 'valid decimal' to convert to datetime) returns 1,041666 (one day and one hour), but only show 01:00:00 (should be 25:00:00).
how can i proceed with that?
IMPORTANT! I need that only with DAX, sadly.
Solved! Go to Solution.
Hi @Anonymous,
For your scenario, I suggest you could calculate the seconds first and then translate the seconds to HH:MM:SS.
seconds = 'Table1'[Distance]/80*3600
To translate the seconds to HH:MM:SS, you could refer to this blog Aggregating Duration/Time.
Here is my test result.
Best Regards,
Cherry
Hi @Anonymous,
For your scenario, I suggest you could calculate the seconds first and then translate the seconds to HH:MM:SS.
seconds = 'Table1'[Distance]/80*3600
To translate the seconds to HH:MM:SS, you could refer to this blog Aggregating Duration/Time.
Here is my test result.
Best Regards,
Cherry
Thank you sooooooooooo much, i was struggling to get this done.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
88 | |
63 |