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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Datediff not working on all rows

I am calculating the number of months between two dates on a table of around 100,000 rows.

 

I'm using this forumula; Term.Months = DATEDIFF(Elements[Start Date],dateadd(Elements[End Date],1,day),MONTH)

 

About 1,500 rows are showing no results, blank.  I am getting good calcs for most of the rows; and the terms vary between 0 and 64 months.

DatediffIssue.PNG

 

3 REPLIES 3
shebr
Resolver III
Resolver III

Hi @Anonymous

 

Can you post an image of some of the dates and columns with no data? the image you posted is cropped.

 

Thanks

 

shebr

Anonymous
Not applicable

The image shows 3 columns, start.date, end.date and term; term is the column that is blank (the issue I'm experiencing).  The datediff calc uses the first two columns, to create the 3rd.

Hi @Anonymous

 

Apologies I saw some items were cropped and assumed that was part of the column.

 

Anyhow, fw things to check. Your PBI Desktop version, ensure you are up to date.

 

Check your region settings in the Options section of your PBI desktop application. It could be that your dates are being determined as dd/mm/yyyy rather than mm/dd/yyyy. Also try changing the columns to a short date format (for testing purposes) to see if that helps.

 

Let me know how you get on.

 

Thanks

 

shebr

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.