I'm trying to get the remaining years with which a driver's license will expire, i'm making use of the Driver's License Expiry date column in my dataset , I want the column to show negative for the Drivers license that have expired before Today's date. Here is my DAX. Expiry Year =DATEDIFF(MIN('Employee'[Drivers_License_Expiry_Date], 'Employee'[Today's Date]), MAX('Employee'[Today's Date], 'Employee'[Drivers_License_Expiry_Date]), YEAR)
You can also Concatenate 'YRS' with it ,so it can display the number with 'YRS' afterwards.
Expiry Year = var _expiryYrs = DATEDIFF(MIN('Employee'[Drivers_License_Expiry_Date], 'Employee'[Today's Date]), MAX('Employee'[Today's Date], 'Employee'[Drivers_License_Expiry_Date]), YEAR) RETURN IF ('Employee'[Today's Date] <= 'Employee'[Drivers_License_Expiry_Date], _expiryYrs & " Yrs", -1 * _expiryYrs & " Yrs")
It worked perfectly
mmbr1606
9
Super User 2025 Season 1
SD-13050734-0
6
Jon Unzueta
2