Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ac10304
Frequent Visitor

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 😞

1 ACCEPTED SOLUTION
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

View solution in original post

4 REPLIES 4
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @ac10304,

 

Could you please mark the proper answers as solutions?

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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

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 bi

 

thanks again

Anonymous
Not 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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.