Forum Discussion
decarsul
Helper V
5 years agoClean up my code
Good day all, Currently i'm working on creating a measure for net throughput time between two timestamps, where i will eventually cut out the outside business hours and weekends / holidays and i'...
- 5 years ago
Hi decarsul ,
Would you accept this as a cleaner way?
Date.From([Datetime created]) & Time.From("08:00:00")
Payeras_BI
Solution Sage
5 years agoHi decarsul ,
Would you accept this as a cleaner way?
Date.From([Datetime created]) & Time.From("08:00:00")
decarsul
Helper V
5 years agoHi Payeras_BI ,
It prevents a double conversion, so it is clearner for sure!
Wonder if there's more ways.
- Anonymous5 years agoNot applicable
You could try
end_time - max(start_time,8)
let Origine = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrcyNrAyMFDSUTI0tzI0VYrViVYysACyoIJmViYQQQsrA0OgWpAYkAnWAxI2B8kja7ZAMS0WAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [st = _t, et = _t]), #"Modificato tipo" = Table.TransformColumnTypes(Origine,{{"st", type time}, {"et", type time}}), #"Aggiunta colonna personalizzata" = Table.AddColumn(#"Modificato tipo", "nt", each Duration.TotalSeconds([et]-List.Max({[st],#time(8,0,0)}))) in #"Aggiunta colonna personalizzata"I would be curious to know what kind of company is the one that counts the working time up to the second. Maybe it's a watch factory? 😁
- decarsul5 years ago
Helper V
On Topic: Interesting approach, but i don't think ill use that bit.
Off topic:
Haha, you really got a point there, but i'm geussing the answer is: a company who wants to overuse their compute resources 😛