Forum Discussion
DAX Head Scratcher
But the two expressions are not identical.
CALCULATE (
SUM ( OptionSelection[Quantity] ),
QuotesContracts[PlanID] = __PlanID
)
is equivalent to:
CALCULATE (
SUM ( OptionSelection[Quantity] ),
FILTER ( ALL ( QuotesContracts[PlanID] ), QuotesContracts[PlanID] = __PlanID )
)
which differs from
CALCULATE (
SUM ( '1OptionSelection'[Quantity] ),
FILTER ( '1QuotesContracts', [PlanID] = __PlanID )
)
in its inclusion of the ALL statement.
As in the example I gave in my previous post, it seems that, when employed in conjunction with cross-filtering from a related table, the evaluated tables resulting from the two seemingly similar expressions may not be of the same dimension (cf my previous example, in which the 'straight' CALCULATE version - that which incorporates an implicit ALL function - evaluates to a table comprising significantly more rows than the non-ALL, FILTER version).
Regards
Jos_Woolley OK, but where is that captured in the actual DAX query from Performance Analyzer? In both cases the query is the following and I don't see an ALL anywhere:
// DAX Query
DEFINE
VAR __DS0Core =
SUMMARIZECOLUMNS(
ROLLUPADDISSUBTOTAL(
ROLLUPGROUP('1OptionMaster'[OptionID], '1OptionMaster'[PlanID], '1Plans'[PlanID]), "IsGrandTotalRowTotal"
),
"v1Frequency", '1OptionMaster'[1Frequency]
)
VAR __DS0PrimaryWindowed =
TOPN(
502,
__DS0Core,
[IsGrandTotalRowTotal],
0,
'1OptionMaster'[OptionID],
1,
'1OptionMaster'[PlanID],
1,
'1Plans'[PlanID],
1
)
EVALUATE
__DS0PrimaryWindowed
ORDER BY
[IsGrandTotalRowTotal] DESC,
'1OptionMaster'[OptionID],
'1OptionMaster'[PlanID],
'1Plans'[PlanID]- PaulOlding5 years ago
Solution Sage
The difference is in the measure definition in this line
"v1Frequency", '1OptionMaster'[1Frequency]
- Jos_Woolley5 years ago
Solution Sage