Forum Discussion

qqqube's avatar
qqqube
New Member
1 year ago
Solved

about evaluation context

there is an example in Microsoft training modules 2-aggregation-iterator-functions . and in the higher grain summarization part, it gives a formula: Revenue Avg Order = AVERAGEX( VALUES('Sales ...
  • qqqube's avatar
    1 year ago

    chatgpt gives an answer as follows:

    Execute SUMX

    • For each Sales Order, AVERAGEX passes the current Sales Order as the row context and evaluates the SUMX function.
    • SUMX(Sales, ...) iterates over the Sales table. However, because DAX applies the current row context automatically, the SUMX will only process rows in the Sales table that match the current Sales Order.
    • This is due to DAX’s context propagation, where the outer row context (in this case, the current Sales Order) is passed into the inner calculation, so SUMX operates only on rows that match the Sales Order.