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.
Hello,
I know there is many links on this but seems to be based on having seconds.
I have decimal hrs and seconds but as you can see the sum is incorrect as it should be 92 hrs 15 secs.
Any ideas on how to get this please?
Thanks
Ross
Solved! Go to Solution.
This is one way to do this (not directly) with a custom column in the query editor with this formula. Place this in the pop-up box when you add a custom column. The "let" only stores the duration in a variable so that it is not calculated twice.
let dur - #duration(0, Number.RoundDown([Annual Leave],0)+Number.RoundDown([Annual Leave Carryover],0), Number.Round(100*(Number.Mod([Annual Leave],1) + Number.Mod([Annual Leave Carryover],1)),0),0) en Duration.Days(dur)*24 + Duration.Hours(dur)
Best regards
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@v-kelly-msft I did click the accept as solution yellow button yestereday but looks like you have to click the three dots and do it from there..
Hi @rosscortb ,
Create a column as below:
Column =
var _wholenumber1=TRUNC('Table'[Column1])
var _wholenumber2=TRUNC('Table'[Column2])
var _totalminutes=('Table'[Column1]-_wholenumber1+'Table'[Column2]-_wholenumber2)*100
Return
TRUNC(_totalminutes/60)+_wholenumber1+_wholenumber2+(_totalminutes-60)/100
And you will see:
If you directly add them up ,it will return as a result of sum up,so you need to separate hours and minutes then add them up.
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
This is one way to do this (not directly) with a custom column in the query editor with this formula. Place this in the pop-up box when you add a custom column. The "let" only stores the duration in a variable so that it is not calculated twice.
let dur - #duration(0, Number.RoundDown([Annual Leave],0)+Number.RoundDown([Annual Leave Carryover],0), Number.Round(100*(Number.Mod([Annual Leave],1) + Number.Mod([Annual Leave Carryover],1)),0),0) en Duration.Days(dur)*24 + Duration.Hours(dur)
Best regards
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @rosscortb ,
So your issue is solved,right?If so,could you pls mark the reply as answered to close it?
I believe more people will benefit from your post.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
@rosscortb , is it 91 hours 58 minute + 15 Min then it will 92 hours 13 Min . can you explain
Hi @rosscortb ,
Then is it possible on your side to round the annual leave decimal hrs then add it to the Carryover column?
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 |
---|---|
96 | |
93 | |
83 | |
70 | |
65 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |