Skip to main content

the difference between Summarize and SummarizeColumns

Table of Contents

In Power BI, both SUMMARIZE and SUMMARIZECOLUMNS are used to create summary tables by aggregating data, but they differ in their syntax, flexibility, and underlying behavior. Here’s a comparison:

FeatureSUMMARIZESUMMARIZECOLUMNS
PurposeCreates a summary table by grouping data and applying aggregations.Creates a summary table by grouping data and applying aggregations with an optional filter.
Expression TypeA combination of grouping columns and aggregation expressions.Grouping columns and aggregation expressions, but can be simplified in certain cases.
Filter ContextSupports implicit filter context, including filters from the current report or model.Requires explicit filter context, provided as arguments in the function (or no filters if none specified).
Behavior with FiltersImplicitly considers the current filter context (e.g., visual filters or row context).Allows explicit filters to be applied using filter expressions or sets of data.
ComplexityMore flexible but also more complex, as it can include more customized filtering.Simpler and more direct syntax for filtering.
SyntaxSUMMARIZE(table, grouping_column1, grouping_column2, ..., aggregation_column1, aggregation_function(...))SUMMARIZECOLUMNS(grouping_column1, grouping_column2, ..., aggregation_function(...), filters...)
Handling of Filter ContextAutomatically respects the existing filter context unless filters are explicitly defined.Explicitly defines filter context (if provided).
PerformanceCan sometimes be less performant with complex filter context due to its flexibility.Tends to perform better with simpler cases and clear filter context.
Use CaseBest used when you need more flexibility, such as adding custom columns or expressions in the summary table.Best used when you need a straightforward summary with clear grouping and filters.

SUMMARIZE Example:

SUMMARIZE(
    Sales, 
    Sales[ProductCategory], 
    Sales[Region], 
    "TotalSales", SUM(Sales[SalesAmount])
)

SUMMARIZECOLUMNS Example:

SUMMARIZECOLUMNS(
    Sales[ProductCategory], 
    Sales[Region], 
    "TotalSales", SUM(Sales[SalesAmount])
)

Add comment