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
Anonymous
Not applicable

Medir rango x por n superior de la medida y

Hola

Quiero ser capaz de filtrar una tabla por rango de medida x por la parte superior n de la medida y. O de otra manera quiero ser capaz de filtrar una mesa por el top 5 vendedor para EL YOY% de los 30 mejores para las ventas totales.

He probado rangos anidados, resumen, topn pero no puedo obtener el resultado que busco.

Cualquier ayuda procreada, y anima con antelación.

VendedorTotal de VentasYOY%rangoArriba
A1000010%11
B90009%22
C80008%33
D70007%44
E60006%55
F50005% 6
G40004% 7
H30003% 8
I20002% 9
J10001% 10

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@shsx , Puede filtrar Top de las siguientes maneras

Ejemplo

Rango de la ciudad: RANKX(all(Geography[City]),[Ventas])

Filtro

Rank Top 10- CALCULATE(if([City Rank]<-10,[Sales],BLANK()) ,VALUES(Geography[City]))
Rango Top 10 1 á sumx(VALUES(Geography[City]),if([City Rank]<-10,[Sales],BLANK()) )
Top 10 Rango de ciudad : CALCULATE([Sales],TOPN(10,all(Geography[City]),[Sales],DESC),VALUES(Geography[City Id]))

Para rango Consulte estos enlaces
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@shsx , Puede filtrar Top de las siguientes maneras

Ejemplo

Rango de la ciudad: RANKX(all(Geography[City]),[Ventas])

Filtro

Rank Top 10- CALCULATE(if([City Rank]<-10,[Sales],BLANK()) ,VALUES(Geography[City]))
Rango Top 10 1 á sumx(VALUES(Geography[City]),if([City Rank]<-10,[Sales],BLANK()) )
Top 10 Rango de ciudad : CALCULATE([Sales],TOPN(10,all(Geography[City]),[Sales],DESC),VALUES(Geography[City Id]))

Para rango Consulte estos enlaces
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

mahoneypat
Employee
Employee

Por favor, pruebe esta expresión para obtener el resultado deseado. Asumo que las ventas totales y el porcentaje DE AÑOs son medidas, por lo que puede reemplazar el CALCULATE(SUM(...)) respectivo con solo la medida como [Ventas totales] o [YOY%].

Top 5 of Top 10 =
VAR topsales =
    TOPN (
        10,
        ALL ( Ranks[Salesperson] ),
        CALCULATE ( SUM ( Ranks[Total Sales] ) )
    )
VAR topYOY =
    RANKX ( topsales, CALCULATE ( SUM ( Ranks[YOY%] ) ),, DESC )
RETURN
    IF ( topYOY <= 5, topYOY )

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


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.