Forum Discussion

Cyriackpazhe's avatar
Cyriackpazhe
Helper III
1 year ago
Solved

Summarize

When we write summarize  Summarize( Sales, product[code], Customer[id],"Total", Sum(Sales(Qty)) When we add the new column in the summarize table, why isn't a calculate required??  
  • vivek31's avatar
    1 year ago

    HI Cyriackpazhe ,

    When you add a new column in a summarize table, calaulate is not required because summarize inherently creates a row contextfor each group. Aggregation functions (like sum, Average, Count) naturally work within this row context.

    Key Points

    1. summarize Creates a Row Context for Groups
      When you use summarize, it groups the table by the specified columns. For each group, the aggregations (like sum) are automatically evaluated in the context of that group.

    2. Implicit Context Handling
      The aggregation functions in DAX, such as sum, are context-aware. In summarize, these functions automatically operate within the context of the grouped rows.

      If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

      Thank you




  • Fowmy's avatar
    1 year ago

    Cyriackpazhe 

    If you need to modify the calculation then you need a CALCULATE otherwise, SUMMARIZE works based on the grouped rows without needing a context transition operation.