From the course: Advanced Power BI: DAX Language, Formulas, and Calculations

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

DATEDIFF DAX function

DATEDIFF DAX function

Another powerful date or time intelligence function in DAX language is DATEDIFF. It calculates the duration between a start date and an end date in the first and second parameters of the function. The result it returns depends not only on the start date and end date, but also on the time unit interval we specify in the third parameter of the function. The time unit intervals we specify in the DATEDIFF function can be day, hour, minute, month, quarter, second, week or year. If we look at the approach for the loan calculations in model one, we can trace many of the components of these calculations back to the loan period at which we are calculating measures like the interest or principle paid during a given period. The loan period serves as the pivot coordinates for many of these loan calculations. Much like we would refer to a single cell in an Excel formula. However, DAX works on tables and columns instead, which means we…

Contents