March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi!
I have ancontered a problem with a DAX measure. I want to calculate an integer times the time as you can see in the DAX below:
When i calculate x5 and display it in a table in PB everything is fine and it calculates as it should but when i calculate x6 the result is wrong, i get a result but it's wrong. I think this is due to the fact that x3 is alot bigger integer than x4 is, so when im stepping over one day i.e., 24 hours it starts over. Below you can se the result from x6: (i only have data for jan-maj 2023)
So if we calculate what is should be: x2 = 00:01:27 and x4 = 1816,
00:01:27 in seconds = 87 seconds.
87 seconds * 1816 = 157 992 seconds, now we transform it back:
hours = 157 992/3600 =~ 43.887 => 43 hours
minutes = 157 992/3600 -43 =~ 0.887 hours => 0.887*60 = 53.2 minutes
seconds = 53.2-53 = 0.2 minutes => 0.2*60 = 12 seconds
So the answer should be 43:53:12 for januari but as you can see it's 19:53:12.
If we put one and one togheter we can see that 19:53:12 + 24:00:00 = 43:53:12, so as i said after 24 hours it starts over. It does not happend for x5 since x3 is so small. Here is the data in the table:
How can i fix this so it dosent start over but instead just add on more hours, minutes and seconds?
Thanks in advanced!
Solved! Go to Solution.
@Ludvig Try looking at these links.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486
https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92
Thanks it works fine!
@Ludvig Try looking at these links.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486
https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |