Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
RRushing
New Member

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.

1.jpg

 

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
1 ACCEPTED SOLUTION
dax
Community Support
Community Support

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.

View solution in original post

3 REPLIES 3
RRushing
New Member

handing this project off to someone else. No need to reply anymore.

 

thank you

dax
Community Support
Community Support

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.

Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Also, See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors