Forum Discussion
Anonymous
3 years agoNot applicable
Filter context and variables (can someone explain different results?)
Using the following DAX I am trying to calculate the change in average monthly total sales over time at region level: MA REGION = VAR _mindate = MIN('Date'[Date]) VAR _table = CALCUL...
johnt75
Super User
3 years agoVariables in DAX aren't really variables, they're constants which are only evaluated once, at the point where they are declared.
In your second 2 examples you are creating a static table and then applying a filter to 'Date'[Date], but the Date table cannot filter the variable because it isn't part of the model.
If you wanted to use the technique in your third example you would need to include in the summary table a numeric representation of month year and you would then be able to use that as a filter.