Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
User | Count |
---|---|
84 | |
76 | |
69 | |
48 | |
39 |
User | Count |
---|---|
111 | |
56 | |
51 | |
42 | |
41 |