Forum Discussion

AhmadBakr's avatar
AhmadBakr
Icon for Helper IV rankHelper IV
2 years ago
Solved

Filter precedence in DAX functions

Greetings folks,   I was surprised that the two below definitions resulted in totally different results. The first (using FILTER and ALL) gave the correct result, while the second counted all the r...
  • AhmadBakr's avatar
    AhmadBakr
    2 years ago

    Anonymous 

    For this case, the result is correct, and identical to the FILTER case. If we use the same logic, then also here COUNTAX will return a scalar value hence all conditions will be meaningless.

     

    I guess the dynamics of applying the filters is that filters coming from CALCULATE conditions are applied, then the table is evaluated and the expression is calculated. In my failing case, the condition coming from CALCULATE was overpowered by the ALL wrapped around the table name in the COUNTAX, hence cleared the condition filter.

     

    I hope my guessing is right!