OpenBI Docs Buy

ROLLUPISSUBTOTAL

In ADDMISSINGITEMS, rolled-up columns paired with the subtotal columns ROLLUPADDISSUBTOTAL made.

Group: Table manipulation. Compatible with DAX.

Syntax

ROLLUPISSUBTOTAL ( [<grandTotalFilter>,] <groupBy_columnName>, <isSubtotal_columnName> [, <groupLevelFilter>]
    [, <groupBy_columnName>, <isSubtotal_columnName> [, <groupLevelFilter>]] … )
ParameterTypeDescription
grandTotalFilterTable
optional
A filter for the grand total row only.
groupBy_columnNameColumn
repeatable
A grouping column of the summary.
isSubtotal_columnNameColumn
repeatable
The TRUE/FALSE column that ROLLUPADDISSUBTOTAL made for it, as [Name].
groupLevelFilterTable
optional, repeatable
A filter for the subtotal rows of the column before it.

Returns

No value. It pairs the grouping columns of ADDMISSINGITEMS with the subtotal flags of the summary.

Remarks

  • It takes the place of the grouping columns of ADDMISSINGITEMS, after the summary, when the summary was made with ROLLUPADDISSUBTOTAL: missing items are then added on every level, with their flags filled in.
  • Name each column with the flag ROLLUPADDISSUBTOTAL made for it, in the same order, the levels of one ROLLUPADDISSUBTOTAL in one ROLLUPISSUBTOTAL.
  • The show-all columns before the summary stay plain columns. ROLLUPISSUBTOTAL put there is an error.

Examples

Missing items with subtotals

Categories and products with their subtotals, the kind of query Power BI writes for a matrix that shows items without data: the products without such months come back blank, on their category's level.

EVALUATE
ADDMISSINGITEMS (
    Products[Category],
    Products[Product],
    SUMMARIZECOLUMNS (
        ROLLUPADDISSUBTOTAL ( Products[Category], "Category total", Products[Product], "Product total" ),
        FILTER ( ALL ( Sales[Liters] ), Sales[Liters] > 2000 ),
        "Shop months", COUNTROWS ( Sales )
    ),
    ROLLUPISSUBTOTAL ( Products[Category], [Category total], Products[Product], [Product total] )
)
ORDER BY [Category total], Products[Category], [Product total], Products[Product]
Products[Category]Products[Product]Category totalProduct totalShop months
BeerIPAFALSEFALSE9
BeerLettølFALSEFALSE(blank)
BeerPilsFALSEFALSE252
Beer(blank)FALSETRUE261
CiderCiderFALSEFALSE(blank)
Cider(blank)FALSETRUE(blank)
(blank)(blank)TRUETRUE261

Put where the show-all columns go

ROLLUPISSUBTOTAL belongs after the summary.

EVALUATE
ADDMISSINGITEMS (
    ROLLUPISSUBTOTAL ( Products[Product], [Is total] ),
    SUMMARIZECOLUMNS (
        ROLLUPADDISSUBTOTAL ( Products[Product], "Is total" ),
        "Shop months", COUNTROWS ( Sales )
    ),
    ROLLUPISSUBTOTAL ( Products[Product], [Is total] )
)

Result: an error.

ADDMISSINGITEMS, ROLLUPADDISSUBTOTAL, SUMMARIZECOLUMNS, ROLLUPGROUP.

Last updated · OpenBI Studio 0.3.74