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.
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
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 |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |