Forum Discussion

Estyfodense's avatar
Estyfodense
Icon for Helper I rankHelper I
6 years ago

chart Hours

1º Have to calculate a difference between Final Hour and Start hour, per day.

 

_01Total HH = 
    CALCULATE(
        SUMX('hh tsv','hh tsv'[Final Time]-'hh tsv'[Star Time]),
            'hh tsv'[Action] in{"Production"},'hh tsv'[product] in {"P13"}
            )

 

 

 

2ºAfeter this I will use a matrix to organize the result

So i have to adapt the measure to show right total hour

 

 

 

 

 

 

Total HH = INT('hh tsv'[_01Total HH])*24+FORMAT('hh tsv'[_01Total HH],"hh")&":"&FORMAT('hh tsv'[_01Total HH],"nn")

 

 

 3º after this I calculate the extra hour, to saturday's I have to subtract 04:00hrs the Total HH to other days just 08:00 hrs 

 

_02 Horas extra = [_01Total HH] - IF( WEEKDAY(MAX('hh tsv'[DATE]),1) = 7 ,TIME(4,0,0), TIME(8,0,0))

 

 

to right formt the total extra hour I use 

 

Total Extra hour = SUMX(VALUES('hh tsv'[DATE]),[_02 Horas extra])

 

 

4º I have to divide the extra hour per total hour, to analyse em porcentagem how many extra hours I did in relation total hh and plot it in a chart and plot a char the total hour per day . But How I'm use measure until here I dont know how to do it.

 

2 Replies