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, estoy luchando teniendo esta medida para trabajar.
Me gustaría tener una medida que sumará el valor sólo para la versión máxima para cada casa.
Así que a continuación de esta tabla de ejemplo:
House_Id | Version_Id | Valor |
1 | 1 | 1000 |
1 | 2 | 2000 |
2 | 1 | 3000 |
3 | 1 | 5000 |
El resultado de esta medida debe ser: 10.000 porque se omite la house_id 1 versión 1, ya que hay otra versión más alta.
En House_id el resultado debe ser:
House_Id | Valor |
1 | 2000 |
2 | 3000 |
3 | 5000 |
¿Alguien puede ayudarme?
¡Gracias!
Hola @janscas , ¿puedes probarlo? Reemplace table1 por su propio nombre de tabla.
Algo como esta medida:
MSum = VAR _maxVer = CALCULATE(MAX(TableR[Version_Id]), ALLEXCEPT(TableR, TableR[House_Id]))
RETURN
CALCULATE(SUM(TableR[Value]), TableR[Version_Id] = _maxVer)
Pruebe con un conjunto de datos de muestra más grande
No,
Esto regresaría sólo 2000
@janscas , Crear una medida como esta y anuncio
Medida ?
VAR __id - MAX ( 'Tabla'[House_Id] )
VAR __Version_Id - CALCULATE ( MAX( 'Table'[Version_Id] ), ALLSELECTED ( 'Table' ), 'Table'[House_Id] - __id )
RETURN CALCULATE ( sum ( 'Table'[Value] ), VALUES ( 'Table'[House_Id ), 'Table'[House_Id] - __id, 'Table'[Version_Id] - __Version_Id )
Hola @janscas ,
Pruebe esta medida:
@janscas esto lo hará
Measure =
SUMX (
VALUES ( 'Table'[House_Id] ),
CALCULATE (
MAX ( 'Table'[Value] ),
ALLEXCEPT ( 'Table', 'Table'[House_Id] )
)
)
Me 💖 Kudos 🙂 si mi solución me ayudara.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@janscas ah, me perdí eso, pensé que querías el valor más alto de la casa ignorando la versión, pero creo que estás buscando el valor de la versión más alta de la casa.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@janscas aquí es, añadir las dos medidas siguientes y la medida 2 hará el trabajo
Measure =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[House_Id] ),
'Table'[Version_Id] = MAX ( 'Table'[Version_Id] )
)
)
Measure 2 = SUMX ( VALUES ( 'Table'[House_Id] ), [Measure] )
Me 💖Kudos 🙂 si mi solución me ayudara.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@parry2k Esto no funciona también. La opinión es que la medida debe resumir por House_Id en el Max(Version_Id), a continuación, hacer un INNER JOIN con la tabla principal. A continuación, suma en esta tabla virtual.
Pero no sé cómo hacer esto con Dax.
@janscas Parece que no veo todos los detalles. Ver la solución adjunta y funciona, se puede tomar desde allí o proporcionar lo que me estoy perdiendo.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
ok @parry2k Funciona en su versión, pero en reallity tengo más variables, como Color_Id y más.
Por lo tanto, si quiero sumar por color_Id en lugar de House_Id No funciona.
@parry2k Eso es correcto quiero sumar los valores de todas las casas, pero sólo donde el identificador de versión es el máximo en cada casa.
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 | |
2 | |
2 | |
2 | |
1 |