Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Full hours measure

Hi, 

 

I would need to make a measure, that calculates how many hours was saved from deadline or how many hours later the task was completed in full hours. 

 

I have already found out the total time that was saved or that went overtime, but now I need to turn it into full hours with some special requirements. For example, if the task was completed 1h 1min before the deadline, then 1 hour is saved, but if it was completed 59min before deadline, then it was done in time and no savings. If it was completed 1min-59min after deadline, then it went 1hour overtime etc. 

 

How would be the easiest way to calculate this?

 

Thank you in advance, 

Liis

  • Anonymous's avatar
    Anonymous
    8 years ago

    I managed to make this kind of measure that seems to work: 

    Rounded hours = if([Saved Hours]>=0;ROUNDUP([Saved Hours];0);ROUNDDOWN([Saved Hours];0))

     

    Saved hours is another measure = deadline - task completed time. 

7 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Anonymous

    As tested, It can calculated by these measures

    time = MAX([deadline])-MAX([completed])
    
    saved or over = IF(MAX([deadline])>MAX([completed]),"+","-")
    
    full hour = HOUR([time])
    
    full time text = IF([full hour]=1,FORMAT(CONCATENATE(CONCATENATE(HOUR([time]),":"),"00"),"hh/mm"),"no saving")
    
    full time = IF([full hour]=1,TIMEVALUE([full time text]))

     

     

     

    Best Regards

    Maggie

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks v-juanli-msft, but what if the savings is for example 15h ? And also, since full time text is type text, then it cannot be summed together, which I would also need to do. 

      • v-juanli-msft's avatar
        v-juanli-msft
        Community Support

        Hi Anonymous

        Could you show me some data, since I don't understand why you need to sum and which to sum?

         

        Best Regards

        Maggie