Forum Discussion

RRushing's avatar
RRushing
New Member
6 years ago
Solved

Calculate weekly hours worked from last accident date until today or specific date

Hello

I am trying to calculate hours worked since last accident date and if no accident then hire date.

I am a novice in BI.

I have attached picture of my model and some backup information. This is my calculation so far. I get results totaling since hire date. Accident dates are pictured and an employee might have more than one date in the table so I need the MAX date.

 

Any help here would be appreciated.

 

"Hours Since Last Incident = CALCULATE(SUM(PR_CHECK_HISTORY_MC[TotalHours]), FILTER(ALL(PR_CHECK_HISTORY_MC[History_Date_List2].[Date]), PR_CHECK_HISTORY_MC[History_Date_List2].[Date] <= MAX(HR_INCIDENTS_MC[Incident_Date].[Date])))"
 
thank you
  • Hi RRushing,

    You could refer to my sample to see whether it work or not.

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies