ROLLUPGROUP
In ROLLUP or ROLLUPADDISSUBTOTAL, columns rolled up together as one level.
Group: Table manipulation. Compatible with DAX.
Syntax
ROLLUPGROUP ( <groupBy_columnName> [, <groupBy_columnName>] … )
| Parameter | Type | Description |
|---|---|---|
groupBy_columnName | Column repeatable | A column to roll up together with the others named. |
Returns
No value. It marks columns that ROLLUP or ROLLUPADDISSUBTOTAL subtotal as a single level.
Remarks
- Columns in one ROLLUPGROUP get no subtotal between them: rolling up the category and the product together gives the product rows and a grand total, but no total per category.
- Use it inside ROLLUP (in
SUMMARIZE) or ROLLUPADDISSUBTOTAL (inSUMMARIZECOLUMNS).
Examples
One level in SUMMARIZE
EVALUATE
SUMMARIZE (
Sales,
ROLLUP ( ROLLUPGROUP ( Products[Category], Products[Product] ) ),
"Liters", SUM ( Sales[Liters] ),
"Total", ISSUBTOTAL ( Products[Category] )
)
ORDER BY [Total], Products[Category], Products[Product]
| Products[Category] | Products[Product] | Liters | Total |
|---|---|---|---|
| Beer | IPA | 331884 | FALSE |
| Beer | Lettøl | 169179 | FALSE |
| Beer | Pils | 1004326 | FALSE |
| Cider | Cider | 301074 | FALSE |
| (blank) | (blank) | 1806463 | TRUE |
One level in SUMMARIZECOLUMNS
EVALUATE
SUMMARIZECOLUMNS (
ROLLUPADDISSUBTOTAL ( ROLLUPGROUP ( Products[Category], Products[Product] ), "Total" ),
"Liters", [Liters sold]
)
ORDER BY [Total], Products[Category], Products[Product]
| Products[Category] | Products[Product] | Total | Liters |
|---|---|---|---|
| Beer | IPA | FALSE | 331884 |
| Beer | Lettøl | FALSE | 169179 |
| Beer | Pils | FALSE | 1004326 |
| Cider | Cider | FALSE | 301074 |
| (blank) | (blank) | TRUE | 1806463 |