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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I'm getting an error with the below script and I can't see why its comming up. Can anyone please correct me on this?
if TERMINATION DATE = 31/12/4721 then
Duration.Days(Date.From(DateTime.LocalNow()) - [CONTINUOUS SERVICE DATE]) /12)
else
Duration.Days([TERMINATION DATE]-[CONTINUOUS SERVICE DATE])/12)
Solved! Go to Solution.
Update, solved it myself as below
if [TERMINATION DATE] = #date(4721, 12, 31) then
Duration.Days(Date.From(DateTime.LocalNow()) - [CONTINUOUS SERVICE DATE]) /12
else
Duration.Days([TERMINATION DATE]-[CONTINUOUS SERVICE DATE])/12
Update, solved it myself as below
if [TERMINATION DATE] = #date(4721, 12, 31) then
Duration.Days(Date.From(DateTime.LocalNow()) - [CONTINUOUS SERVICE DATE]) /12
else
Duration.Days([TERMINATION DATE]-[CONTINUOUS SERVICE DATE])/12
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 |
|---|---|
| 61 | |
| 54 | |
| 39 | |
| 16 | |
| 14 |
| User | Count |
|---|---|
| 98 | |
| 84 | |
| 35 | |
| 30 | |
| 25 |