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
Syndicate_Admin
Administrator
Administrator

TOP 10 FILTRO: CAMBIAR COLUMNAS

Tengo esta tabla que está filtrada por los 10 clientes con las ventas más altas como puedes ver a continuación. Utilicé el filtro optio TOP N Pero ahora necesito este visual para mostrarme los 10 mejores clientes a partir del año más reciente. así que 2021. no 2019.

Además de esto, tengo una cortadora de tiempo que me permite elegir el rango de años que quiero ver. En este caso elegí 2019 a 2021. Sin embargo, necesito que los 10 principales clientes estén organizados en función del año 2021. ¿Sabes cómo hacerlo, por favor?

The customers are filtered on the left by the top 10, but it  follows only 2019. I need the filter to affect the most recent year so 2021 ( i also have a ltime slicer  that shows a range of years.Los clientes se filtran a la izquierda por el top 10, pero solo sigue 2019. Necesito que el filtro afecte al año más reciente, así que 2021 (también tengo una cortadora de tiempo que muestra un rango de años.

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Hay @peraltm1 ,

Intente crear una medida como la siguiente y configárelo como "es 1" en el campo "Filtros en este visual". (Filtro el top 3 debido a mi pequeña muestra).

Measure = 
VAR MaxYear_ =
    CALCULATE ( MAX ( 'Table'[Year] ), ALLSELECTED ( 'Table'[Year] ) )
VAR Category_ =
    SUMMARIZE (
        TOPN (
            3, ----------change it to 10 in your scenario
            SUMMARIZE (
                FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Year] = MaxYear_ ),
                'Table'[Category],
                "SumValue_", SUM ( 'Table'[Value] )
            ),
            [SumValue_], DESC
        ),
        [Category]
    )
RETURN
    IF ( MAX ( 'Table'[Category] ) IN Category_, 1 )

Icey_0-1636611526329.png

Saludos

Helado

Si este post Ayuda, a continuación, por favor considere Acéptalo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hay @peraltm1 ,

Intente crear una medida como la siguiente y configárelo como "es 1" en el campo "Filtros en este visual". (Filtro el top 3 debido a mi pequeña muestra).

Measure = 
VAR MaxYear_ =
    CALCULATE ( MAX ( 'Table'[Year] ), ALLSELECTED ( 'Table'[Year] ) )
VAR Category_ =
    SUMMARIZE (
        TOPN (
            3, ----------change it to 10 in your scenario
            SUMMARIZE (
                FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Year] = MaxYear_ ),
                'Table'[Category],
                "SumValue_", SUM ( 'Table'[Value] )
            ),
            [SumValue_], DESC
        ),
        [Category]
    )
RETURN
    IF ( MAX ( 'Table'[Category] ) IN Category_, 1 )

Icey_0-1636611526329.png

Saludos

Helado

Si este post Ayuda, a continuación, por favor considere Acéptalo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Syndicate_Admin
Administrator
Administrator

@peraltm1 , Cree una medida para el año más reciente y el top 10 sobre eso y úselo como filtro

ventas =
var _max = Año(maxx(allselected('Fecha'),'Fecha'[Fecha]))
devolución
calculate(sum(Table[sales amount]) , filter('Date', 'Date'[Year] =_max))


Top10 = calculate(sum(Table1[sales]),TOPN(10,allselected(table[Customer]),sum(Table1[sales]),DESC), values(table[Customer]))

Usar top 10 como filtro de nivel visual

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.