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...
Ya, of course I went to see what marcorusso had to say! :) But ... somehow it didn't help me. At least from a pure functionality perspective -- as that seems to do more w/ performance.
And yet, I'm not convinced they are functionally equivalent.
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