09-27-2018 07:47 AM
I was in need of some help in calculating the number of days between events. I am trying to calculate how long employees were in certain roles or on certain projects. Below is how my data table is modeled.
|Date||Employee ID||Role/Project||Event||Days Employed|
|1/1/2018||01||New Hire||New Hire||1|
|1/8/2018||01||Level 1||Role Change||8|
|1/15/2018||01||Level 2||Role Change||15|
In my model, New Hire and Intern are considered as the same position essentially.
Any help is greatly appreciated.
09-27-2018 08:13 AM
I'm guessing a column and use of EARLIER. See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...
Did I answer your question? Mark my post as a solution!
Proud to be a Datanaut!
09-28-2018 12:43 AM
You may refer to below dax to create calculated columns.
Role/Project 2 = IF ( Table3[Role/Project] = "Intern", "New Hire", Table3[Role/Project] )
Long = COUNTROWS ( FILTER ( Table3, Table3[Role/Project 2] = EARLIER ( Table3[Role/Project 2] ) ) )
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.