Forum Discussion

ac10304's avatar
ac10304
Frequent Visitor
7 years ago
Solved

DateDiff adding an extra day?

I have a simple DateDiff function to calculate the # of months between a "date received" column and whatever the current date is.

 

My function is: Num Months Open = DATEDIFF(Table1[Date Received], TODAY(), MONTH)

 

 

 

I filtered to show only 7-9 months.

On the left, the last row shows a date received value of 2/21/2018, which shouldnt be 7 months it should be 6 months because today is 9/20/2018. In excel, it shows the right number of returned values, but in Power BI it shows 2/21/2018 as being 7 months.

I'm not sure why it's doing this, essentially DateDiff in power bi should be the same as DateDif in excel right?

 

I'd appreciate any help on this, i'm stuck :(

  • Anonymous's avatar
    Anonymous
    7 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

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    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