Forum Discussion

EdK99's avatar
EdK99
Frequent Visitor
3 years ago
Solved

math operators on hours

Hello,

 

I am developing a dashboard to analyze billable hours and overtime hours, my table has two time columns, "Work start time" and "Work finish time", I want to create a logic that will check whether the finishing time is after 18:00 or not, and if so, calculate how many hours of overtime it is. I've tried to apply basic math operators like greater than, but I don't think they work with that format. Any idea on how to do this?

  • Hi, add extra column in Power Query or Power Bi, and seperate the time from this column and make formula like this 

    IF Value([Time]) > TimeValue(18:00) then overtime else normal

    and next make another column Value([Time]) - TimeValue(18:00). In power BI You can fillter next this quantity by "Overtime/Normal".  I wasn't input the formula in a line with power m/dax standards, only for expleaning the meaning.

  • Hi EdK99 ,

    try this calculated column

    Overtime =
    VAR _18_Time = 0.75
    RETURN
    IF(
        [WorkFinish] > _18_Time,
        [WorkFinish] - _18_Time
    )
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • Hi, add extra column in Power Query or Power Bi, and seperate the time from this column and make formula like this 

    IF Value([Time]) > TimeValue(18:00) then overtime else normal

    and next make another column Value([Time]) - TimeValue(18:00). In power BI You can fillter next this quantity by "Overtime/Normal".  I wasn't input the formula in a line with power m/dax standards, only for expleaning the meaning.

  • Hi EdK99 ,

    try this calculated column

    Overtime =
    VAR _18_Time = 0.75
    RETURN
    IF(
        [WorkFinish] > _18_Time,
        [WorkFinish] - _18_Time
    )
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.