Returns the year fraction representing the number of whole days between start_date and end_date.
The start date in datetime format.
The end date in datetime format.
The type of day count basis to use.
Fraction of the year.
If the argument is a string, it is translated into a datetime value using the same rules applied by the DATEVALUE function.
YEARFRAC can be used to compute the current age of a customer based on the difference between the current day and the customer’s birthdate, but because of a bug it is suggested to use another technique (also faster) based on quotient and floor, as described in related content.
Learn more about YEARFRAC in the following articles:
Other related functions are:
Contributors: Alberto Ferrari, Marco Russo
MSDN documentation: https://docs.microsoft.com/en-us/dax/yearfrac-function-dax