Press "Enter" to skip to content

YEARFRAC() in Power Query

Imke Feldmann translates an Excel function to Power Query:

While there is a native YEARFRAC-function in DAX that you can use to calculate year fractions, sometimes you might just need it in Power Query. The function I’m presenting here has the same function arguments than its Excel-equivalent. Its 5 different modes require some advanced calculations. Fortunately I found a great resource on how to calculate it here. So my version here is basically a direct translation into the M-language.

Click through for the code.