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 everyone! Wish you all have a very nice day!
Based on the image above, i have TimeIn & TimeOut. So i try to get the hours between these 2 times, meaning that TimeOut - TimeIn. So based on that simple calculation, i got the hours worked values. But some of the value have -ve sign. I just want to know how many hours worked & i just want to ignore the -ve values. So how can i do that? Thanks in advance 😊
Solved! Go to Solution.
@New_be Try this:
Number.Abs(Number.From([Adj_OutTime]) - Number.From([Adj_InTime])) * 24
@New_be , I think because the out time in on next day
if Duration.Hours([Adj_hour_worked]) <0 then [Adj_hour_worked] + duration(1,0,0) else [Adj_hour_worked]
@New_be , If you have use hour(Adj_hourworked_temp) < 0 and try
or Adj_hourworked_temp <#duration(0,0,0,0)
Indeed! It is because the out time is in the next day & vice versa. Thanks!
@New_be , In case of the issue, is resolved. Accept all suitable solutions for others to get a similar solution.
@New_be - Use Number.Abs to get the absolute value. So formula should be:
Number.Abs([Adj_OutTime] - [Adj_InTime])
I try to use this formula;
But i got the error;
@New_be Try this:
Number.Abs(Number.From([Adj_OutTime]) - Number.From([Adj_InTime])) * 24
@New_be - Cool. Sometimes Power Query really annoys the **bleep** out of me!! 🙂
@New_be Maybe try some spaces? This worked for me
Number.Abs([SampleID] - [Outcome]) * 24
Oh, wait, those are date time, hang on.
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 |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |