Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola expertos,
Me he metido en este problema: Tener esta Matriz. Teniendo un código de hierearchy->Type->Status->Course->Product, me gustaría calcular la Suma de Población , dividida por el número de los registros, dependiendo del nivel de jerarquía:
En este caso, la medida "Pop x grade" está haciendo bien:
Pop x Grade = SUM('Fact'[Population]) /
COUNTROWS('Fact')
Sin embargo, si sumo dos niveles de la jerarquía, me gustaría sumar "Pop x Grade"
El resultado de la victoria, debe ser la suma de (81 +78 +77+78+40+76+77+76+79+79)
¿Cómo puedo crear una medida de este tipo? Estoy tratando de usar las funciones "X", pero estoy atascado en él.
¿Alguna idea?
Puede encontrar un ejemplo de PBIX aquí:
Solved! Go to Solution.
Hola, @danimelv , pls probar medida
Segmentation =
SWITCH (
TRUE (),
ISINSCOPE ( 'Fact'[Product] ) || ISINSCOPE ( 'Fact'[Course] ), [Pop x Grade],
ISINSCOPE ( 'Fact'[Probability] ),
SUMX (
VALUES ( 'Fact'[Course] ),
[Pop x Grade]
),
ISINSCOPE ( 'Fact'[Type] ), "Type", // change to any calculation at your own will
"Code" // change to any calculation at your own will
)
En cuanto al nivel "Tipo" o "Código", puede utilizar cualquier otro cálculo a su propia voluntad.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hola @CNENFRNL !
¿Cómo puedo cambiar la línea a nivel de "Tipo" y "Código" si quiero que los resultados en "Tipo" sean iguales a la suma de "Probabilidad" definida en la cláusula ISINSCOPE anterior? Con la misma lógica, me gustaría ver resultados a nivel de "Código" igual suma de "Tipo". He intentado esto, pero no mostró la cantidad total correcta en el nivel "Tipo" y "Código".
Segmentation =
SWITCH (
TRUE (),
ISINSCOPE ( 'Fact'[Product] ) || ISINSCOPE ( 'Fact'[Course] ), [Pop x Grade],
ISINSCOPE ( 'Fact'[Probability] ),
SUMX (
VALUES ( 'Fact'[Course] ),
[Pop x Grade]
),
ISINSCOPE ( 'Fact'[Type] ),
SUMX (
VALUES ( 'Fact'[Probability] ),
[Pop x Grade]
),
ISINSCOPE ( 'Fact'[Code] ),
SUMX (
VALUES ( 'Fact'[Type] ),
[Pop x Grade]
)
)
¡Gracias de antemano!
¡Hola!
¿Cómo puedo cambiar la línea a nivel de "Tipo" y "Código" si quiero que los resultados en "Tipo" sean iguales a la suma de "Probabilidad" definida en la cláusula ISINSCOPE anterior? Con la misma lógica, me gustaría ver resultados a nivel de "Código" igual suma de "Tipo". He intentado esto, pero no mostró la cantidad total correcta en el nivel "Tipo" y "Código".
Segmentation =
SWITCH (
TRUE (),
ISINSCOPE ( 'Fact'[Product] ) || ISINSCOPE ( 'Fact'[Course] ), [Pop x Grade],
ISINSCOPE ( 'Fact'[Probability] ),
SUMX (
VALUES ( 'Fact'[Course] ),
[Pop x Grade]
),
ISINSCOPE ( 'Fact'[Type] ),
SUMX (
VALUES ( 'Fact'[Probability] ),
[Pop x Grade]
),
ISINSCOPE ( 'Fact'[Code] ),
SUMX (
VALUES ( 'Fact'[Type] ),
[Pop x Grade]
)
)
¡Gracias de antemano!
Hola, @danimelv , pls probar medida
Segmentation =
SWITCH (
TRUE (),
ISINSCOPE ( 'Fact'[Product] ) || ISINSCOPE ( 'Fact'[Course] ), [Pop x Grade],
ISINSCOPE ( 'Fact'[Probability] ),
SUMX (
VALUES ( 'Fact'[Course] ),
[Pop x Grade]
),
ISINSCOPE ( 'Fact'[Type] ), "Type", // change to any calculation at your own will
"Code" // change to any calculation at your own will
)
En cuanto al nivel "Tipo" o "Código", puede utilizar cualquier otro cálculo a su propia voluntad.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@danimelv , Dependiendo de la jerarquía si desea cambiar los totales puede nosotros isinscope
ejemplo: Cálculo diferente a un nivel diferente
Medidas ?
SWITCH (
Verdad
ISINSCOPE ( 'Tabla'[Estado] ), [Costing],
ISINSCOPE ( 'Tabla'[Ciudad] ), [Costing1],
blank()
)
hacer referencia para más detalles : https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
Hey @danimelv ,
Por favor, siga esta entrada de blog:
https://www.daxpatterns.com/parent-child-hierarchies/
Si su problema se resuelve, por favor acepte esta respuesta como una solución.
Gracias
Ajinkya
@Ajinkya369 - He creado MM3TR&R para este propósito, teniendo diferentes agregaciones/cálculos en diferentes niveles de un hiearchy.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |