Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Need help with a DAX

Hello All,   I'm stuck with a query to find the date difference in my data set.   Emp Name Process Created Date Completed Date Emp 1 Hire 1/1/2023 1/2/2023 Emp1 Contract 1/5/2023...
  • Igna's avatar
    2 years ago

    Hello,

     

    You could try to calculate the difference between the minimum created date and the maximum completed date for a Emp :

     

    Date Difference = 
    VAR MinCreateDate = CALCULATE(MIN('YourTable'[Created Date]), ALLEXCEPT('YourTable', 'YourTable'[EmpName]))
    VAR MaxCompletedDate = CALCULATE(MAX('YourTable'[Completed Date]), ALLEXCEPT('YourTable', 'YourTable'[EmpName]))
    RETURN MaxCompletedDate - MinCreateDate

     

     

    Tell me if this works 🙂

     

    Igna