Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
Trying to do a simple calculation of days between two dates but although their are no syntax errors in my custom column and error "Expression Error: The name "DATEDIFF" wasn't recognized. Make sure its spelled correctly" comes up. Here's my formula:
DATEDIFF(MIN( Calendar[Enrollment date.Current Registration Status Date] ), MAX( Calendar[Last Accessed]), DAY)
I joined two separate tables so that my dates are in the same Query but I don't think that's the issue. What am I doing wrong?
Thanks,
Val
Solved! Go to Solution.
(MIN( Calendar[Enrollment date.Current Registration Status Date] ) - MAX( Calendar[Last Accessed]) * 1.
Hi @Vtomsons ,
If it needs to be done in power query,using below M code:
Custom = Duration.Days([Date2]-[Date])
And you will see:
If it is done in report view,using below dax expression to create a measure:
Measure = DATEDIFF(SELECTEDVALUE('Table'[Date2]),SELECTEDVALUE('Table'[Date]),DAY)
And you will see:
Or you can create a calculated column as below:
Column = DATEDIFF('Table'[Date],'Table'[Date2],DAY)
And you will see:
Hope the above is what you need.
Hi @Vtomsons ,
If it needs to be done in power query,using below M code:
Custom = Duration.Days([Date2]-[Date])
And you will see:
If it is done in report view,using below dax expression to create a measure:
Measure = DATEDIFF(SELECTEDVALUE('Table'[Date2]),SELECTEDVALUE('Table'[Date]),DAY)
And you will see:
Or you can create a calculated column as below:
Column = DATEDIFF('Table'[Date],'Table'[Date2],DAY)
And you will see:
Hope the above is what you need.
Thanks fellas for the insight. New to all this so it will get easier...I hope.
(MIN( Calendar[Enrollment date.Current Registration Status Date] ) - MAX( Calendar[Last Accessed]) * 1.
Still getting the error"the name MIN wasn't recognized. Make sure its spelled correctly"
Do these two date columns need to be formatted some way? I have them in the date/time
And make sure that you are somewhere that you should be entering DAX code, and not in Query Editor.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.