ISINSCOPE
Whether a column is a level the current row is grouped by: TRUE on its rows, FALSE on the totals above it.
Group: Information. Compatible with DAX.
Syntax
ISINSCOPE ( <columnName> )
| Parameter | Type | Description |
|---|---|---|
columnName | Column | The column of the level asked about. |
Returns
Boolean. TRUE when the column groups the current row of a visual or of SUMMARIZECOLUMNS.
Remarks
- In a matrix with category above product, a product's row has both columns in scope, a category's subtotal only the category, and the grand total neither: a measure can tell its level by asking from the lowest level up.
- Unlike
ISFILTERED, a slicer or aCALCULATEfilter alone does not put a column in scope: on a total row the column may be filtered and still not be in scope. - Unlike
HASONEVALUE, one value left by other filters does not put a column in scope: a category with a single product leaves one product, yet the product column is not in scope on the category's row. - The row filter of
CALCULATEin an iteration (context transition) counts as a grouping too. A filter that replaces the grouping's (CALCULATEwith the column's own filter, orALLof it) takes it out of scope; one added withKEEPFILTERSdoes not.
Examples
Which level is this row?
Products grouped by category and product, with subtotals.
EVALUATE
SUMMARIZECOLUMNS (
ROLLUPADDISSUBTOTAL ( Products[Category], "Category total", Products[Product], "Product total" ),
"Liters", [Liters sold],
"Category in scope", ISINSCOPE ( Products[Category] ),
"Product in scope", ISINSCOPE ( Products[Product] )
)
ORDER BY [Category total], Products[Category], [Product total], Products[Product]
| Products[Category] | Products[Product] | Category total | Product total | Liters | Category in scope | Product in scope |
|---|---|---|---|---|---|---|
| Beer | IPA | FALSE | FALSE | 331884 | TRUE | TRUE |
| Beer | Lettøl | FALSE | FALSE | 169179 | TRUE | TRUE |
| Beer | Pils | FALSE | FALSE | 1004326 | TRUE | TRUE |
| Beer | (blank) | FALSE | TRUE | 1505389 | TRUE | FALSE |
| Cider | Cider | FALSE | FALSE | 301074 | TRUE | TRUE |
| Cider | (blank) | FALSE | TRUE | 301074 | TRUE | FALSE |
| (blank) | (blank) | TRUE | TRUE | 1806463 | FALSE | FALSE |
A share that is not shown on the total
The share of all liters means something per product; on the total it would always be 100 %.
EVALUATE
SUMMARIZECOLUMNS (
ROLLUPADDISSUBTOTAL ( Products[Product], "Total" ),
"Liters", [Liters sold],
"Share",
IF (
ISINSCOPE ( Products[Product] ),
DIVIDE ( [Liters sold], CALCULATE ( [Liters sold], ALL ( Products[Product] ) ) )
)
)
ORDER BY [Total], Products[Product]
| Products[Product] | Total | Liters | Share |
|---|---|---|---|
| Cider | FALSE | 301074 | 0.166664913701526 |
| IPA | FALSE | 331884 | 0.183720341905702 |
| Lettøl | FALSE | 169179 | 0.0936520703717707 |
| Pils | FALSE | 1004326 | 0.555962674021001 |
| (blank) | TRUE | 1806463 | (blank) |
Filtered is not in scope
Cider is filtered out: on the total row the product column is filtered, but no product groups it.
EVALUATE
CALCULATETABLE (
SUMMARIZECOLUMNS (
ROLLUPADDISSUBTOTAL ( Products[Product], "Total" ),
"Liters", [Liters sold],
"In scope", ISINSCOPE ( Products[Product] ),
"Filtered", ISFILTERED ( Products[Product] )
),
Products[Product] <> "Cider"
)
ORDER BY [Total], Products[Product]
| Products[Product] | Total | Liters | In scope | Filtered |
|---|---|---|---|---|
| IPA | FALSE | 331884 | TRUE | TRUE |
| Lettøl | FALSE | 169179 | TRUE | TRUE |
| Pils | FALSE | 1004326 | TRUE | TRUE |
| (blank) | TRUE | 1505389 | FALSE | TRUE |
Related functions
ISFILTERED, HASONEVALUE, ROLLUPADDISSUBTOTAL, SUMMARIZECOLUMNS, ISSUBTOTAL.