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>]] … )
| Parameter | Type | Description |
|---|---|---|
grandTotalFilter | Table optional | A filter for the grand total row only. |
groupBy_columnName | Column repeatable | A grouping column of the summary. |
isSubtotal_columnName | Column repeatable | The TRUE/FALSE column that ROLLUPADDISSUBTOTAL made for it, as [Name]. |
groupLevelFilter | Table 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 total | Product total | Shop months |
|---|---|---|---|---|
| Beer | IPA | FALSE | FALSE | 9 |
| Beer | Lettøl | FALSE | FALSE | (blank) |
| Beer | Pils | FALSE | FALSE | 252 |
| Beer | (blank) | FALSE | TRUE | 261 |
| Cider | Cider | FALSE | FALSE | (blank) |
| Cider | (blank) | FALSE | TRUE | (blank) |
| (blank) | (blank) | TRUE | TRUE | 261 |
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.
Related functions
ADDMISSINGITEMS, ROLLUPADDISSUBTOTAL, SUMMARIZECOLUMNS, ROLLUPGROUP.