Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

In what direction are DAX Variables calculated?

Goodday,

 

I have made a quite complicated measure in DAX, and for performance reasons i would like to know in what direction DAX calculates is variables. Does it start at the RETURN and work backwards, or does it start with the variables?

 

The reason why i want to know is this:

The calculations i do can be boiled down to

VAR A

VAR B

VAR AB = A+B

VAR C

VAR D

VAR CD = C+D

RETURN: AB + CD

 

They are a bit more complicated, but thats the gist of it.
But, the RETURN is actually:

RETURN: IF(Filter = E, 0, AB+CD)

 

So if the filter is set on a specific value, the whole calculation is not needed. I would like to know if it calculated it whole anyways, or that it skips the calculation because it starts with the IF function at the RETURN. 

 

Many thanks for the help!

 

  • All the variables will be calculated in the backend. So this way the performance will be impacted.

2 Replies

  • All the variables will be calculated in the backend. So this way the performance will be impacted.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Fast, easy and to the point. Thank you very much!