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.

Variables in DAX formulas

Variables in DAX formulas

- [Instructor] Using variables and DAX formulas enables us to store formula components as variables, then use them in a result that we return at the end of the formula expression. This enables us to write more efficient formulas that are easier to read, not just for DAX measures, but also DAX tables and columns as well. To use variables and DAX formulas, we'll need to follow the syntax specific to the DAX language for setting them up. We'll store the variables using the VAR syntax to declare the variable, followed by the variable name and the expression it's equal to. we'll then return the result for the DAX expression using the return syntax followed by the expression we want the formula to return from the entire formula, including the calculations that use the variable we set up earlier in the same formula. The remaining balance for a loan at any given point in time, during the loan duration, equals…

Contents