Forum Discussion
DateDiff adding an extra day?
- Anonymous7 years ago
Hi ac10304
DATEDIFF in Power BI doesnt work that way. When you specify the interval as Month, it takes the Month of Date1 & Date 2 and finds the difference. So in your case, 9-2= 7. Even if you find the differene between 2/28/1028 and today in terms of month, it will be 7.
Hope this clears your doubt.
Thanks
Raj
Hi ac10304
DATEDIFF in Power BI doesnt work that way. When you specify the interval as Month, it takes the Month of Date1 & Date 2 and finds the difference. So in your case, 9-2= 7. Even if you find the differene between 2/28/1028 and today in terms of month, it will be 7.
Hope this clears your doubt.
Thanks
Raj
- ac103047 years agoFrequent Visitor
THanks for your reply Anonymous, this helps clear up my confusion.
A follow up question: is there a way to get the results like in excel?
Or is it good practice to have it round up as it shows in power bithanks again
- Anonymous7 years agoNot applicable
Hi ac10304
The below URL has the details of the similar issue.
https://community.powerbi.com/t5/Desktop/DATEDIFF-month-interval-not-working-as-expected/td-p/236011
Can you try this ?
Month Diff =
( 1 * ( [Date2] - [Date1] ) )
/ DAY ( EOMONTH ( [Date2], 0 ) )Thanks
Raj