Hi, @Vnk
Summary tables can be formed by aggregating or grouping the actual data tables.
To do so, Use summarize( ) function.
Summarize( ) returns a summary table for the requested totals over a set of groups.
Syntax: SUMMARIZE(<table>, <groupBy_columnName>[, <groupBy_columnName>]…[, <name>, <expression>]…)
Ex:
SUMMARIZE(ResellerSales_USD , DateTime[CalendarYear] , ProductCategory[ProductCategoryName] , "Sales Amount (USD)", SUM(ResellerSales_USD[SalesAmount_USD]) , "Discount Amount (USD)", SUM(ResellerSales_USD[DiscountAmount]) )
In the above example, ResellerSales_USD is the table name, which is grouped by fields DateTime[CalendarYear] & ProductCategory[ProductCategoryName]. The table then returns a summary table by calculating SUM(ResellerSales_USD[SalesAmount_USD]) and renames column as Sales Amount (USD) and SUM(ResellerSales_USD[DiscountAmount]) as Discount Amount (USD) along with the grouped columns.
The final table structure would be like below.
DateTime[CalendarYear] ProductCategory[ProductCategoryName] Sales Amount (USD) Discount Amount (USD)
Hope it helps.
The example and documentation can be found here.