ISINSCOPE Function (DAX)

How does the ISINSCOPE function (DAX) work?

ISINSCOPE function (DAX) returns true when the given column is the level within a level hierarchy.

ISINSCOPE Formula Syntax

ISINSCOPE (<columnName>)

How do you use the ISINSCOPE function?

It returns TRUE if the column is included in the filter context, and it is a grouping column in the result set for the current row.

Related Blog Posts

Related Support Forum Posts

Accessing Matrix hierarchy levels
Dynamic RANKX with Other Category
Developing Complex Dax functions

Considerations when using the ISINSCOPE function

When ISINSCOPE returns TRUE, then also HASONEVALUE returns TRUE.

Related Video Tutorials

Formula examples using the ISINSCOPE function

DEFINE
MEASURE FactInternetSales[% of Parent] =
  SWITCH (TRUE(),
    ISINSCOPE(DimProduct[Subcategory]),
      DIVIDE(
        SUM(FactInternetSales[Sales Amount]),
        CALCULATE(
          SUM(FactInternetSales[Sales Amount]),
          ALLSELECTED(DimProduct[Subcategory]))
      ),
    ISINSCOPE(DimProduct[Category]),
      DIVIDE(
        SUM(FactInternetSales[Sales Amount]), 
        CALCULATE(
          SUM(FactInternetSales[Sales Amount]),
          ALLSELECTED(DimProduct[Category]))
      ),
    1
  ) * 100
EVALUATE
  SUMMARIZECOLUMNS
  (
    ROLLUPADDISSUBTOTAL
    (
      DimProduct[Category], "Category Subtotal",
      DimProduct[Subcategory], "Subcategory Subtotal"
    ),
    TREATAS(
      {"Bike Racks", "Bike Stands", "Mountain Bikes", "Road Bikes", "Touring Bikes"},
      DimProduct[Subcategory]),
    "Sales", SUM(FactInternetSales[Sales Amount]),
    "% of Parent", [% of Parent]
  )
  ORDER BY
    [Category Subtotal] DESC, [Category],
    [Subcategory Subtotal] DESC, [Subcategory]

Related DAX Functions

CALCULATE
HASONEVALUE
SUMMARIZECOLUMNS

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI
Center of Excellence

DOWNLOAD


Download our comprehensive DAX Formula Reference Guide as perfect companion as you learn how to use DAX formulas within Power BI.


Download DAX Formulas Reference Guide
Download DAX Formula Reference Guide
Membership