Calculate with and without a filter table argument & diff. results

Hello @AussieDragon,

So here’s the additional explanation based on the above queries -

1). No “FILTER()” is not the same as “KEEPFILTERS()”. I’m providing a link below which will answer all your questions about why “KEEPFILTERS()” is more efficient but most importantly, how it’s diffrent from “FILTER()”. In this case, the results were same but that may or may not be the case when we have a chain of relationships between the tables which we call it as “Expanded Tables” (This is another separate topic for discussion, you can refer videos on this over SQLBI website or create a separate thread) and when we use entire table inside the “FILTER()”, it has to iterate/scan over that table or set of tables which are linked via relationships which is not efficient.

2). There’re many DAX functions which works as filter/context modifiers especially, the ones which contains the word “ALL”. Yes, they’re tables functions but when they’re combined with “CALCULATE()”, they also work as a “Context Modifier”. And that was one of the reason why I provided the link above on the topic - “Managing “all” functions in DAX”. Apart from that, “USERELATIONSHIP()”, “TREATAS()”, “CROSSFILTER()”, etc are some of the special functions which also works as a context modifier.

I do sometimes hear videos say replacing the filter context, but that to me would be a combination of either 1 or 2.

It depends upon the scenario that you’re facing or trying to tackle. Sometimes, it may be either-or and sometimes, it can be a combination of 1&2. This functions can only be more understood in-depth by more practicing it since they’re not easily understandable by watching a video once. And when used in a wrong context then might lead to wrong or sometimes even inflated results.

Thanks and Warm Regards,
Harsh

1 Like