Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Oye
¿Podría alguien por favor ayudarme con el siguiente problema, por favor?
Mesa | ||
Categoría | Producto | Valor |
Fruta | manzana | 9 |
Fruta | Plátano | 8 |
Fruta | Naranja | 7 |
Ensalada | Lechuga | 4 |
Ensalada | Tomate | 1 |
Salida deseada | ||
NUEVO producto | Valor | rango |
manzana | 9 | 1 |
Plátano | 8 | 2 |
Naranja | 7 | 3 |
Lechuga | 4 | 1 |
Tomate | 1 | 2 |
Fruta | 24 | 1 |
Ensalada | 5 | 1 |
Hola @lauren1192 ,
Una pequeña modificación a la fórmula por @AllisonKennedy
New Table =
UNION (
SUMMARIZECOLUMNS (
'Table'[Product],
"Value", SUM ( 'Table'[Value] ),
"Rank", IF (
MAX ( 'Table'[Product] )
<> BLANK (),
RANKX (
FILTER (
ALL ( 'Table' ),
'Table'[Category]
= MAX ( 'Table'[Category] )
),
CALCULATE (
SUM ( 'Table'[Value] )
)
)
)
),
SUMMARIZECOLUMNS (
'Table'[Category],
"Value", SUM ( 'Table'[Value] ),
"Rank", IF (
MAX ( 'Table'[Product] )
<> BLANK (),
RANKX (
ALL ( 'Table'[Category] ),
CALCULATE (
SUM ( 'Table'[Value] )
)
)
)
)
)
saludos
Harsh Nathani
Apreciar con un Kudos!! (Haga clic en el botón Pulgares arriba)
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución!
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com