Forum Discussion
Anonymous
4 years agoNot applicable
Filterall calulation does not work in variables
Good sunday everyone Does anyone know why when I use filter(all()) calculations, if it is in a variable measure it does not work but as a separate measure it will work. For e.g., VAR tota...
- 4 years ago
Anonymous Take a look at this article discussing the topic.
https://radacad.com/caution-when-using-variables-in-dax-and-power-biBasically, the CALCULATE will not do anything to the VAR totalsalesofshoes the way your measure is written.
Anonymous
4 years agoNot applicable
Ohh thanks for the article. Then what do u suggest I do? Create a separate measure or is there another solution?
- jdbuchanan714 years ago
Super User
Yes, make it into two measures.
totalsalesofshoes = CALCULATE ( SUM ( totalsales[Sales] ), type = shoes )Final Measure = CALCULATE ( [totalsalesofshoes], FILTER ( ALL ( calendar ), index >= MAX ( dim_Calendar[Index] ) - 5 && dim_Calendar[Index] <= MAX ( dim_Calendar[Index] ) ) )