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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote 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
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 53 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 116 | |
| 107 | |
| 42 | |
| 32 | |
| 26 |