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

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

DIVIDE DAX function

DIVIDE DAX function

DAX has a powerful suite of financial functions that we can use to calculate things like the outstanding balance for a loan. However, there are limitations to these functions. Currently, our loan model calculates the loan period using the dateDef function. The outstanding balance references this measure, so let's see how its results look. It errors out with a message telling us that a function argument is the wrong data type or its results are too large or too small. The updated loan period uses more complex calculation logic under the hood. Let's calculate the balance using other existing model components. The payment and accrual factor measures still work in our summarized visual, so let's use them in the updated balance calculation. We'll first calculate the accrued loan amount by multiplying the selected amount by the accrual factor. Now we need to calculate the accumulated payment total for each loan period. We'll do this by creating a payment factor variable using the divide…

Contents