Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Question about Variables (VAR)

Hi! I have a calculated table that tells me if the client has sold more than 25K in the last 3 Quarters. When I use variables, it doesn't work, when I don't use variables, it does.... Why??? It ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    Looking at the two measures you wrote separately (with and without variables), the first measure with variables, although variables are defined, but does not use it in the later calculations. It seems that the formulas are the same except for the defined variable in these two measures. It is reasonable to assume that the two measures will return the same results...
    You can check the following link to learn more about the use and caution of variables. Variables are calculated within the scope in which they are written, and then the result of them is stored and used in the rest of the expression.

    Use variables to improve your DAX formulas

    Caution When Using Variables in DAX and Power BI

    Best Regards