Compartir a través de


ISINSCOPE

Se aplica a:columna Calculadatabla calculadaMedidacálculo visual

Devuelve true cuando la columna especificada es el nivel de una jerarquía de niveles.

Sintaxis

ISINSCOPE(<columnName>)

Parámetros

Término Definición
columnName Nombre de una columna existente, mediante la sintaxis DAX estándar. No puede ser una expresión.

Valor devuelto

TRUE cuando la columna especificada es el nivel de una jerarquía de niveles.

Observaciones

Esta función no se admite para su uso en el modo DirectQuery cuando se usa en columnas calculadas o reglas de seguridad de nivel de fila (RLS).

Ejemplo

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]

Devuelve

DimProduct[Category] DimProduct[SubCategory] [Subtotal categoría] [Subcategory Subtotal] [Ventas] [% de parent]
TRUE TRUE 28,397,095.65 100.00
Accesorios FALSE TRUE 78,951.00 0.28
Accesorios Bastidores de bicicletas FALSE FALSE 39,360.00 49.85
Accesorios Soportes de bicicletas FALSE FALSE 39,591.00 50.15
Bicicletas FALSE TRUE 28,318,144.65 99.72
Bicicletas Bicicletas de montaña FALSE FALSE 9,952,759.56 35.15
Bicicletas Bicicletas de carretera FALSE FALSE 14,520,584.04 51.28
Bicicletas Bicicletas de paseo FALSE FALSE 3,844,801.05 13.58

SUMMARIZECOLUMNS funciónCALCULATE