OpenBI Docs Buy

ROLLUP

In SUMMARIZE, adds subtotal rows for the columns named.

Group: Table manipulation. Compatible with DAX.

Syntax

ROLLUP ( <groupBy_columnName> [, <groupBy_columnName>] … )
ParameterTypeDescription
groupBy_columnNameColumn
repeatable
A grouping column of the SUMMARIZE that should get subtotals; a ROLLUPGROUP counts as one.

Returns

No value. It marks the grouping columns that SUMMARIZE adds subtotal rows for.

Remarks

  • Put it among SUMMARIZE's grouping columns. With one column it adds a grand total row; with several the totals nest from the last column outwards: products within a category, then each category, then the grand total.
  • On a subtotal row the rolled-up columns are blank, and the expressions are evaluated over the whole group. ISSUBTOTAL tells those rows apart.
  • Grouping columns before the ROLLUP get no totals of their own: a ROLLUP of the product after the category gives a total per category but no grand total.
  • It works only among SUMMARIZE's grouping columns. In SUMMARIZECOLUMNS, use ROLLUPADDISSUBTOTAL.
  • The rows come in no set order: sort them with ORDER BY, an ISSUBTOTAL column first, to put the totals last.

Examples

A grand total

EVALUATE
SUMMARIZE (
    Sales,
    ROLLUP ( Products[Category] ),
    "Liters", SUM ( Sales[Liters] ),
    "Total row", ISSUBTOTAL ( Products[Category] )
)
ORDER BY [Total row], Products[Category]
Products[Category]LitersTotal row
Beer1505389FALSE
Cider301074FALSE
(blank)1806463TRUE

A total per category, no grand total

EVALUATE
SUMMARIZE (
    Sales,
    Products[Category],
    ROLLUP ( Products[Product] ),
    "Liters", SUM ( Sales[Liters] ),
    "Category total", ISSUBTOTAL ( Products[Product] )
)
ORDER BY Products[Category], [Category total], Products[Product]
Products[Category]Products[Product]LitersCategory total
BeerIPA331884FALSE
BeerLettøl169179FALSE
BeerPils1004326FALSE
Beer(blank)1505389TRUE
CiderCider301074FALSE
Cider(blank)301074TRUE

Two nested levels

EVALUATE
SUMMARIZE (
    Sales,
    ROLLUP ( Products[Category], Products[Product] ),
    "Liters", SUM ( Sales[Liters] ),
    "Category total", ISSUBTOTAL ( Products[Product] ),
    "Grand total", ISSUBTOTAL ( Products[Category] )
)
ORDER BY [Grand total], Products[Category], [Category total], Products[Product]
Products[Category]Products[Product]LitersCategory totalGrand total
BeerIPA331884FALSEFALSE
BeerLettøl169179FALSEFALSE
BeerPils1004326FALSEFALSE
Beer(blank)1505389TRUEFALSE
CiderCider301074FALSEFALSE
Cider(blank)301074TRUEFALSE
(blank)(blank)1806463TRUETRUE

SUMMARIZE, ISSUBTOTAL, ROLLUPGROUP, ROLLUPADDISSUBTOTAL.

Last updated · OpenBI Studio 0.3.74