Forum Discussion

rtaylor's avatar
rtaylor
Helper III
7 years ago
Solved

Difference in values for seeming same measures

Can anyone share any insight as why these dax measures have different results? I can't find any literature on why this would be the case. I've noticed the phenomena twice so far. First Measure se...
  • d_gosbell's avatar
    7 years ago

    rtaylor wrote:
    Can anyone share any insight as why these dax measures have different results? I can't find any literature on why this would be the case. I've noticed the phenomena twice so far.
     
     

    The reason is that variables are calculated once within the scope where they are defined. So in your second measure set the "occu" variable will be calculated once for all dates in the current context, this makes the MAXX(SUMMARIZE(...)) call redundant as occu will have the same value for every row.

     

    Whereas in the first measure set when you reference one measure within the summarize in the second measure the expression is re-evaluated within the context of the summarize.