DAX Aggregation - SUMMARIZE function


Advertisements


Description

Returns a summary table for the requested totals over a set of groups.

Syntax

SUMMARIZE (<table>, <groupBy_columnName>, [<groupBy_columnName>] …, 
   [<name>, <expression>] …) 

Parameters

Sr.No. Parameter & Description
1

table

Any DAX expression that returns a table of data.

2

groupBy_columnName

The qualified name of an existing column to be used to create summary groups based on the values found in it. This parameter cannot be an expression.

3

name

The name given to a total or summarize column, enclosed in double quotes.

4

expression

Any DAX expression that returns a single scalar value, where the expression is to be evaluated multiple times (for each row/context).

Return Value

A table with the selected columns for the groupBy_columnName parameters and the summarized columns designed by the name parameters.

Remarks

  • Each column for which you define a name must have a corresponding expression. Otherwise, an error is returned. The first parameter, ‘name’ defines the name of the column in the results. The second parameter, ‘expression’ defines the calculation performed to obtain the value for each row in that column.

  • groupBy_columnName must be either in table or in a related table to table.

  • Each name must be enclosed in double quotation marks.

  • The function groups a selected set of rows into a set of summary rows by the values of one or more groupBy_columnName columns. One row is returned for each group.

Example

= SUMMARIZE ( 
   SalesTarget,SalesTarget[SalesTarget],"MaxTarget",MAX (SalesTarget[SalesTarget])) 

dax_functions_aggregation.htm

Advertisements