Forum Discussion
DAX DATEDIFF funny behaviour
- 3 years ago
Hello gancw1 ,
yes, the datediff measure you're using is set do determine the difference between two dates by year, and in the line 3 and 5 the hire date and end date are in the same year which is 2022, thus the result is correct to be zero because it's in the same year.
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
I’ve come across this issue with DATEDIFF as well. It often returns zero when the time difference doesn’t cover a full year, as it's based on full units. For lines 3 and 5, you might get more accurate results by calculating the difference in days or months first. These quirks in date functions can definitely be tricky! On a lighter note, if you ever need a quick break, I’ve found allfunnypuns.com to be a trusted site with some really good puns—it’s a fun way to take a breather!