Forum Discussion
FILTER vs CALCULATETABLE
- 9 years ago
Anonymous wrote:What if I remove CALCULATETABLE from the language. What do we lose?
CALCULATETABLE triggers context transition whereas FILTER does not. Andy by itself, FILTER creates a row context whereas CALCULATETABLE does not. But other than these, it is a question for Marco if he is lurking around out there...potential performance issues per his article I referenced would be one thing I would think...
Hi Anonymous
"Filter" can generate a row context while "Calculatetable" can't. In the example below, the formulas are very similar. Both work but bring us different results. Hope this would help.
Filter_NumOfCities = COUNTROWS ( FILTER ( 'Table15', 'Table15'[CITY] = EARLIER ( Table15[CITY] ) ) )
Calculatetable_NumOfCities =
COUNTROWS (
CALCULATETABLE ( 'Table15', 'Table15'[CITY] = EARLIER ( 'Table15'[CITY] ) )
)
Best Regards!
Dale
Thanks Dale, that *is* interesting.. though, I wish I could better wrap my head around what is happening in your example :)
* Since the formulas "work"... there must be an EARLIER( ) context, which suggets... a context was created!?
* Unclear why Santa Monica is different than the others (I assume related to the hidding data?)