Forum Discussion

RandVac's avatar
RandVac
Frequent Visitor
2 years ago
Solved

What's the difference between these 2 queries?

A small data model with two tables <Dfact> <Ddim> <Ddim>[SubCategory] (1) --- (*) <Dfact>[SubCategory] The first query returns 3.    Whereas the second query returns 1.   ...
  • ThxAlot's avatar
    2 years ago

    This is what happens under the hood for query 1,

     

    For any CALCULATE() / CALCULATETABLE(), DAX engine evaluates all filter arguments ( 1.expanded table and 2.predicate in your case ) independently from each other before final evaluation.

     

    More specifically,

    1.expanded table

    filters Ddim via [related C] and [related SC] (data lineage kept)

    2.predicate

    doesn't propagate the filtering to Ddim due to 1:* direction constraint by default.

     

    An alternative to query 2 is