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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
VictorDario97
New Member

Problemas con TopN Mismo resultado

Buenas, estoy haciendo un dashboard con data abierta de Bullying en el Perú y quiero hacer un top 10 de los subtipos de violencia, cabe recalcar que son datos tipo string, y utlice este dax : 

Top10 = CALCULATE([Subtipos],TOPN(10,ALL('DM Facts'[SUBTIPO_VIOLENCIA]),[Subtipos],DESC),VALUES('Tipo de SubViolencia'[SUBTIPO_VIOLENCIA]))
[Subtipos] es COUNTROWS('DM Facts')
Sin embargo, me arroja todos los mismos resultado top.png
¿Porque saldria todos los top10 el mismo resultados? Muchas gracias.
1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

El TOPN está cambiando el contexto del ajustador para anular la línea, pruébelo con un KEEPFILTERS.

Top10 =
CALCULATE (
    [Subtypes],
    KEEPFILTERS (
        TOPN ( 10, ALL ( 'DM Facts'[SUBTIPO_VIOLENCIA] ), [Subtypes], DESC )
    )
)

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Hola

Comparta el enlace de descarga del archivo PBI.

No sabia que tenia que compartir el enlace de descarga.

Syndicate_Admin
Administrator
Administrator

El TOPN está cambiando el contexto del ajustador para anular la línea, pruébelo con un KEEPFILTERS.

Top10 =
CALCULATE (
    [Subtypes],
    KEEPFILTERS (
        TOPN ( 10, ALL ( 'DM Facts'[SUBTIPO_VIOLENCIA] ), [Subtypes], DESC )
    )
)

Efectivamente este es la solución, muchas gracias.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors