Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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 | 1/6/2023 |
I need to calculate the difference between the created and completed date (highlighted in bold), but I'm unable to get the dax for the same. Can anyone help me write this out?
Thanks for the help in advance!!
Solved! Go to Solution.
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
Oh, ok
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
Create a column using datediff function.
Ex.
This will not work as the two dates are not in the same row
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.