Forum Discussion

New_be's avatar
New_be
Helper V
5 years ago
Solved

Create Hours

Hi everyone, 

how can i create static hours based on a condition in power query?
For example, if working shift is MORNING, then 8 hours.

i try to make something like this;


if [ShiftID] = "NORMAL" then #duration(0,8,30,0)*24 else
if [ShiftID] = "OFFICE" then #duration(0,9,05,0)*24 else null)

But if the duration is #duration(0,8,30,0)*24, then the output will be 8.12:00:00. The output that i want is 8:30. Meaning that 8 hours 30 mins. 
Can anybody help me with this please? thanks in advance

1 Reply