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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Month DateDiff round down to nearest month

Hi Everyone,

When I'm using the DateDiff Function to get the difference between two dates it works fine, however it rounds up my dates and I would like to round this down. E.g if the difference in months is 16 months and 16 days, it rounds it up to 17 months . However I would like to round down to 16. Similarly if the difference is 23 days, I would like it to round down to 0 month as opposed to 1 etc. I have tried using INT(DateDiff(XXX) however the issue is still the same.

Thank you in advance

P
1 ACCEPTED SOLUTION
rafaelmpsantos
Responsive Resident
Responsive Resident

Hi Datediff in always ROUNDUP, for Always rounddown you may use -1 like this:


diference = DATEDIFF(Table1[Column1];Table1[Column2];MONTH)-1

View solution in original post

5 REPLIES 5
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

How did you create the formula? It seems right to your needs. Please refer to the snapshot below.

Month-Date-Diff-round-down-to-nearest-month

 

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.
rafaelmpsantos
Responsive Resident
Responsive Resident

Hi Datediff in always ROUNDUP, for Always rounddown you may use -1 like this:


diference = DATEDIFF(Table1[Column1];Table1[Column2];MONTH)-1

Anonymous
Not applicable

This is not acceptable solution.  Subtracting one will create problems for you in other situations

Correct, the solution is not to subtract 1. Any ideas what the solution is? I'm trying to do a calculation for Years of Service. Some of the values are getting rounded up (i.e., 5 or more months).

Anonymous
Not applicable

Thank you 🤗🤗

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.