Forum Discussion
FILTER vs CALCULATETABLE based on Boolean Expression
- Anonymous5 years ago
That's because the second argument to FILTER must ALWAYS be a logical condition (or castable to it) that operates for each row of the table in the first argument (FILTER is an iterator) and all CALCULATETABLE's arguments must ALWAYS be tables. DATESBETWEEN returns a table.
Even the seemingly logical condition in:
calculatetable( A, T[Col] = Value )
is internally translated into:
calculatetable( A, Filter( All(T[Col]), T[Col] = Value ).
So the "logicals" under CALCULATETABLE are just syntactic sugar.
- Anonymous5 years ago
If you read the ultimate source of knowledge on DAX, which is The Book, you'll find the explanation of the use of the seemingly "logical expressions" under CALCULATETABLE that I gave you. No, what the docs mention is syntactic sugar. Only.
Check this out: How CALCULATE works in DAX - SQLBI
Well, Microsoft is just not telling you the whole truth but The Italians do.
Anonymous This just sealed the deal for me-