Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi All,
I want to get the difference between 2 dates, StartDate and EndDate columns. (format are date for both)
I am using the 'Add Custom Column' in Power Query.
=Number.RoundUp(([EndDate]-[StartDate])/365)
I get the error here stated we cannot convert the value #duration(2,0,0,0) to type number.
May I know what is the workaround?
Thank you.
Solved! Go to Solution.
The corrected formula In Power Query would be:
=Number.RoundUp(Duration.Days([EndDate]-[StartDate])/365)
Otherwise this would not be my prefered way to calculate years between dates.
The corrected formula In Power Query would be:
=Number.RoundUp(Duration.Days([EndDate]-[StartDate])/365)
Otherwise this would not be my prefered way to calculate years between dates.
Custom Column = DATEDIFF([End Date], [Start Date], DAY)
Make sure Start and end date are in Date/Time format and DAY should not be a function.
Thanks,
Himanshu
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 49 | |
| 40 | |
| 32 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 85 | |
| 70 | |
| 37 | |
| 28 | |
| 27 |