Hello,
I'm trying to put together a system to report the time spent in Outlook tasks, specifically the total of work hours by day (the sum of the time spent with each task in a day), and the sum of work hours that surpass 8 work hours by day. I was able to create the following DAX measure:
HE = IF(CALCULATE( SUM('Relatorios Equipa'[Horas Trabalhadas]); ALLEXCEPT('Tempo'; Tempo[Data])) > 8; CALCULATE( SUM('Relatorios Equipa'[Horas Trabalhadas]); ALLEXCEPT('Tempo'; Tempo[Data])) - 8)
The same DAX in English:
HE = IF(CALCULATE( SUM('Team Report'[Work Hours]); ALLEXCEPT('Time'; Time[Date])) > 8; CALCULATE( SUM('Team Report'[Work Hours]); ALLEXCEPT('Time'; Time[Date])) - 8)
This DAX is meant to check for the total work hours (HT) within each day and, if greater than 8h, it will subtract 8h so the result will be the number of extra hours worked in a day (HE). It works, except that it aplies the same calculation rule to the total in the table, which means that it sums all the work hours and subtracts 8h, instead of doing the sum of the resulting extra work hours only. Here is an image:
Is there a way around this so I can get the total of extra work hours?
Thank you.