OpenBI Docs Buy

ROLLUPADDISSUBTOTAL

In SUMMARIZECOLUMNS, adds subtotal rows for columns, with a column saying which rows are subtotals.

Group: Table manipulation. Compatible with DAX.

Syntax

ROLLUPADDISSUBTOTAL ( [<grandtotalFilter>,] <groupBy_columnName>, <name> [, <groupLevelFilter>]
    [, <groupBy_columnName>, <name> [, <groupLevelFilter>]] … )
ParameterTypeDescription
grandtotalFilterTable
optional
A filter for the grand total row only.
groupBy_columnNameColumn
repeatable
A grouping column to subtotal, or a ROLLUPGROUP of several.
nameText
repeatable
The name of the TRUE/FALSE column that marks its subtotal rows.
groupLevelFilterTable
optional, repeatable
A filter for the subtotal rows of the column before it.

Returns

No value. It marks the columns SUMMARIZECOLUMNS adds subtotal rows for, and names the columns that flag them.

Remarks

  • For each column, SUMMARIZECOLUMNS adds a TRUE/FALSE column of the name given: TRUE on its subtotal rows, where the column itself is blank.
  • Several columns in one ROLLUPADDISSUBTOTAL nest: the last is subtotalled within the earlier ones, and the first gives the grand total.
  • Grouping columns outside it get no totals: with Places[Kind] before it, each kind of place gets its own total.
  • A ROLLUPGROUP inside it rolls its columns up together, as one level.
  • It works only inside SUMMARIZECOLUMNS; in SUMMARIZE, use ROLLUP.

Examples

A grand total row

EVALUATE
SUMMARIZECOLUMNS (
    ROLLUPADDISSUBTOTAL ( Products[Category], "Is total" ),
    "Liters", [Liters sold]
)
ORDER BY [Is total], Products[Category]
Products[Category]Is totalLiters
BeerFALSE1505389
CiderFALSE301074
(blank)TRUE1806463

Two nested levels

EVALUATE
SUMMARIZECOLUMNS (
    ROLLUPADDISSUBTOTAL ( Products[Category], "Category total", Products[Product], "Product total" ),
    "Liters", [Liters sold]
)
ORDER BY [Category total], Products[Category], [Product total], Products[Product]
Products[Category]Products[Product]Category totalProduct totalLiters
BeerIPAFALSEFALSE331884
BeerLettølFALSEFALSE169179
BeerPilsFALSEFALSE1004326
Beer(blank)FALSETRUE1505389
CiderCiderFALSEFALSE301074
Cider(blank)FALSETRUE301074
(blank)(blank)TRUETRUE1806463

A total within each kind of place

EVALUATE
SUMMARIZECOLUMNS (
    Places[Kind],
    ROLLUPADDISSUBTOTAL ( Products[Category], "All categories" ),
    "Liters", [Liters sold]
)
ORDER BY Places[Kind], [All categories], Products[Category]
Places[Kind]Products[Category]All categoriesLiters
ShopBeerFALSE1505389
ShopCiderFALSE301074
Shop(blank)TRUE1806463

SUMMARIZECOLUMNS, ROLLUPGROUP, ROLLUPISSUBTOTAL, ROLLUP, ISSUBTOTAL.

Last updated · OpenBI Studio 0.3.74