cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

CALCULATETABLE filter is removed

can someone explain to me why the code below, return a list of all the rows in the SaleTerritoty table?

 

EVALUATE 
CALCULATETABLE (
    CALCULATETABLE ( 
        'Sales Territory',
        ALL ( 'Sales Territory'[Country] ) 
    ),
    'Sales Territory'[Country] = "United States" 
)
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: CALCULATETABLE filter is removed

Hi @elahemeydani

 

You will find this article very useful

https://www.sqlbi.com/articles/order-of-evaluation-in-calculate-parameters/


"the order of execution of CALCULATE and CALCULATETABLE parameters is different from other DAX functions

The order of evaluation of the parameters of a function is usually the same as the order of the parameter: the first parameter is evaluated, then the second, then the third, and so on. This is always the case for most of the DAX functions, but not for CALCULATE and CALCULATETABLE. In these functions, the first parameter is evaluated only after all the others have been evaluated"

2 REPLIES 2
Super User
Super User

Re: CALCULATETABLE filter is removed

Hi @elahemeydani

 

You will find this article very useful

https://www.sqlbi.com/articles/order-of-evaluation-in-calculate-parameters/


"the order of execution of CALCULATE and CALCULATETABLE parameters is different from other DAX functions

The order of evaluation of the parameters of a function is usually the same as the order of the parameter: the first parameter is evaluated, then the second, then the third, and so on. This is always the case for most of the DAX functions, but not for CALCULATE and CALCULATETABLE. In these functions, the first parameter is evaluated only after all the others have been evaluated"

Re: CALCULATETABLE filter is removed

@Zubair_Muhammad

I am wondering why I didn't see this article before !!!!!
Thank you so much Zubair