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 - Power BI Tutorial
From the course: Advanced Power BI: DAX Language, Formulas, and Calculations
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
ALL DAX function5m 2s
-
(Locked)
POWER DAX function5m 37s
-
(Locked)
DIVIDE DAX function6m 22s
-
(Locked)
Variables in DAX formulas7m 4s
-
(Locked)
Iterator DAX functions and SUMX7m 9s
-
(Locked)
FILTER DAX function7m 15s
-
(Locked)
Challenge: Rate of change by commodity55s
-
(Locked)
Solution: Rate of change by commodity2m 37s
-
-
-