This article is about SUMMARIZE function, which groups rows in data models. It¨s little similar to Pivot Tables in common Excel or to groupping in Power Query (Get and Transform). The result of SUMMARIZE is always a table. Which means it can be used in new table in data models, or, in combination with other function, for new measure or new column creation - so as it results in one number.

We will use this table with sales data:

If you want to see, for example, total sums and total counts of revenue for particular weekdays, you can write:

Totals = 
     SUMMARIZE('original data';
     'original data'[Weekday];
     "Total revenue"; SUM('original data'[Revenue]);
     "Number of items"; COUNT('original data'[Revenue]))

Because:

  • Totals - name of the new table
  • SUMMARIZE('original data'; - the table we want to summarize
  • 'original data'[Weekday]; - column for groupping
  • "Total revenue"; SUM('original data'[Revenue]); - name of the first summarizing column and how is it going to be calculated
  • "Number of items"; COUNT('original data'[Revenue])) - name of the first summarizing column and how is it going to be calculated

The result will be like this:

2 Comments

Leave a Reply

Your email address will not be published.

*

clear formPost comment