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
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]