ISINSCOPE DAX Function
The ISINSCOPE function returns true when the specified column is the level in a hierarchy of levels.
DAX Syntax
The function parameter columnName is the name of the existing column. It cannot be an expression.
Example: Create a measure.
DAX
Measure 3 = IF( ISINSCOPE(Sheet1[Name]), [12th Marks Measure], BLANK() )
Explanation:
• ISINSCOPE(Sheet1[Name]): This function checks if the current context is within the scope of the Name column (i.e., an individual name, not a country).
• [12th Marks Measure]: Returns the measure value for individual names.
• BLANK(): Ensures that any subtotal levels (like countries) return a blank value, thus hiding the subtotal.
Step 2: Use the Measure in a Matrix 1. Add a Matrix visualization to your report.
2. Drag the relevant fields into the Rows and Columns areas of the matrix.
3. Drag the modified measure (Measure 3) into the Values area.
Step 3: Configure the Matrix Ensure your matrix visualization is set up to show the hierarchy and to use the measure correctly:
1. Rows: Add the hierarchical levels (e.g., Country, Name).
2. Values: Use the new measure (Measure 3).
Final Notes: By using ISINSCOPE, you ensure that the measure only returns values for the lowest level in the hierarchy (individual names) and blanks for higher levels (such as countries), effectively hiding the subtotals for countries. This approach customizes the display of values in the matrix to fit your specific reporting needs.