OpenBI Docs Buy

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> )
ParameterTypeDescription
columnNameColumnThe 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 a CALCULATE filter 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 CALCULATE in an iteration (context transition) counts as a grouping too. A filter that replaces the grouping's (CALCULATE with the column's own filter, or ALL of it) takes it out of scope; one added with KEEPFILTERS does 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 totalProduct totalLitersCategory in scopeProduct in scope
BeerIPAFALSEFALSE331884TRUETRUE
BeerLettølFALSEFALSE169179TRUETRUE
BeerPilsFALSEFALSE1004326TRUETRUE
Beer(blank)FALSETRUE1505389TRUEFALSE
CiderCiderFALSEFALSE301074TRUETRUE
Cider(blank)FALSETRUE301074TRUEFALSE
(blank)(blank)TRUETRUE1806463FALSEFALSE

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]TotalLitersShare
CiderFALSE3010740.166664913701526
IPAFALSE3318840.183720341905702
LettølFALSE1691790.0936520703717707
PilsFALSE10043260.555962674021001
(blank)TRUE1806463(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]TotalLitersIn scopeFiltered
IPAFALSE331884TRUETRUE
LettølFALSE169179TRUETRUE
PilsFALSE1004326TRUETRUE
(blank)TRUE1505389FALSETRUE

ISFILTERED, HASONEVALUE, ROLLUPADDISSUBTOTAL, SUMMARIZECOLUMNS, ISSUBTOTAL.

Last updated · OpenBI Studio 0.3.74