Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
CJ_96601
Helper V
Helper V

Top 25% de la cantidad más alta

Consulte la tabla de muestras y aconseje cómo obtener el 25% superior de los registros totales en función de la cantidad más alta .. Gracias

1100
2100
3200
41000
55000
6200
7200
8600
9500
10300
11100000
12100000
133000000
14100000
15100000
16200
171000
185000
191000
205000
16 REPLIES 16
v-easonf-msft
Community Support
Community Support

Hola , @CJ_96601

También puede intentar crear una columna de clasificación:

Rank Column = RANKX('Table', 'Table'[Value]+ 'Table'[ID]*0.1, , DESC)

A continuación, cree una medida de control visual y la aplique a la tabla visual:

25% Top SUM = 
VAR  RankNum25_ =COUNTROWS(ALL('Table'))*0.25
VAR  a=SELECTEDVALUE('Table'[Rank Column])
return IF(RankNum25_>=a,1,0)

El resultado se mostrará como se muestra a continuación:

11.png

Ps: Para las filas en blanco que mencionó, creo que sólo necesita aplicar condiciones de filtro de antemano en el edior de consulta.

12.png

Saludos
Equipo de soporte de la comunidad _ Eason

@parry2k ,

Estaba tratando de replicar tu solución y tengo una pregunta. Mis valores devueltos consisten en números positivos y negativos. ¿Hay alguna manera de que TOPN me dé los valores topN que incluya valores negativos? Actualmente, si todos mis números topN son todos positivos, funciona muy bien, pero una vez que alcanza un número negativo, no parece devolver todos los elementos TopN.

Hola , @hnguyen76

¿Lo has resuelto? En caso afirmativo, podría aceptar la respuesta útil como solución. También podría compartir su propia solución aquí. Por ahora, no hay contenido de descripción en el subproceso. Si todavía necesita ayuda, por favor comparta más detalles con nosotros.

Saludos
Equipo de soporte de la comunidad _ Eason

Ashish_Mathur
Super User
Super User

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hola

Su pregunta no está clara. Muestre el resultado exacto que está esperando con una explicación.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mahoneypat
Employee
Employee

Esta expresión de medida devuelve la suma de valores que por encima del 75% del valor máximo. ¿Eso es lo que necesitabas? Si es así, reemplace Table3 por el nombre de la tabla.

Top 25% Sum =
VAR __75PctValue =
    CALCULATE ( MAX ( Table3[Value] ), ALLSELECTED ( Table3 ) ) * 0.75
RETURN
    CALCULATE ( SUM ( Table3[Value] ), Table3[Value] >= __75PctValue )

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


mahoneypat

Gracias por su respuesta. la medida que proporcionó obtiene la cantidad más alta solamente y no el 25%.

Ejecuté su medida y el resultado es 3M (el más alto de todos los registros), el resultado esperado es 3.4M (punto 11-15 de mi tabla de muestra) siendo el 25% superior de los registros totales con la cantidad más alta.

BnHoras extras
1100
2100
3200
41000
55000
6200
7200
8600
9500
10300
11100,000.00
12100,000.00
133,000,000.00
14100,000.00
15100,000.00
16200
171000
185000
191000
205000

¿Puede ayudar en eso, por favor

No estaba seguro de exactamente lo que querías. Gracias por la explicación. Esta expresión de medida suma los valores para el 25% superior.

Top 25% Sum 2 =
VAR __25pctcount =
    ROUND ( 0.25 * COUNTROWS ( Table3 ), 0 )
RETURN
    CALCULATE (
        SUM ( Table3[Value] ),
        TOPN ( __25pctcount, Table3, Table3[Value], DESC )
    )

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Gracias por la medida MahoneyPat

Recogió la cantidad más alta de todos los registros, pero recogió más de ese 25% de los registros totales.

debe recoger sólo 5 partidas con el importe más alto (5 representa el 20 %) del total de registros (de 20 partidas individuales)

Agradezco si usted podría ayudar más.

saludos

@CJ_96601 que probaste mi medida? 2a cosa, creo que sus matemáticas no son correctas - 20% de 20 es 4 no 5 y debe ser 25%. No estoy seguro de lo que intentabas decir allí.



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.

MahoneyPat,

Después de comprobar cuidadosamente el resultado, me di cuenta de que incluye filas en blanco en el cálculo del 25%.

¿Hay alguna manera de eliminar eso aparte de mí eliminar manualmente las filas después del último registro.

saludos

@parry2k, tal vez sólo está mirando una solución a la vez.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

@hnguy71 Supongo que sí. Bueno, en cuanto a una solución, está bien.



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.

MahoneyPat,

Probado su medida. Funcionó y recogió la cantidad máxima, pero supera el 25% (5 líneas de pedido de 20 registros, matemáticas incorrectas en el mensaje anterior)

Recogió más de 5 partidas individuales. ¿Hay alguna manera de arreglarlo?

saludos

@CJ_96601 Yo haría esto

Top 5 = 
VAR __totalId =  CALCULATE ( DISTINCTCOUNT ( 'Table'[Id] ) , ALL ( 'Table'[Id] ) )
VAR __total25 =  INT ( __totalId * .25 )
VAR _top5 = CALCULATETABLE ( VALUES ( 'Table'[Id] ), TOPN ( __total25,  ALL ( 'Table'[Id] ) , [Sum Amount], DESC ) )
VAR _filterTable = INTERSECT ( VALUES ( 'Table'[Id] ), _top5 ) 
RETURN
CALCULATE ( [Sum Amount], _filterTable )

Le permitirá ver en cada nivel de identificación, no sólo la suma

Me gustaría elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!

Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.



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.

La solución proporcionada fue buena. También quiero encontrar el promedio en la misma consulta. ¿Cómo hacerlo?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors