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
dcg38524
Helper III
Helper III

Los mejores artistas filtran el año actual (HOY)

Hola

He intentado modificar el script DAX a continuación a"Filtrar año actual"tiempos de servidor, pero no hay suerte. El código funciona muy bien, pero sin el filtrado en el lugar simplemente no estoy recibiendo los resultados deseados Sé que me estoy perdiendo algo simple simplemente No estoy seguro de qué o a dónde ir a continuación.

¿Hay que filtrar "Año 2020" en el código DAX que se enumera a continuación?

Su ayuda y orientación serán muy apreciadas.

Gracias

Top Service = 
VAR temp_table =
    SUMMARIZE (
        ALL ( CROutages[Service] ),
        CROutages[Service],
        "SericeTotalValue", COUNTA( CROutages[IDkey] )    
    )
RETURN
    CALCULATE (
        MAX ( CROutages[Service] ),
        FILTER (
            ADDCOLUMNS ( temp_table, "Rank", RANKX ( temp_table, [SericeTotalValue] ) ),
            [Rank] = 1
        )
 
    )

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@dcg38524

Prueba algo como esto:

Top Service = 
VAR temp_table =
    SUMMARIZE (
        ALL ( CROutages[Service] ),
        CROutages[Service],
        "SericeTotalValue", COUNTA( CROutages[IDkey] )    
    )
RETURN
    CALCULATE (
        MAX ( CROutages[Service] ),
        FILTER (
            ADDCOLUMNS ( temp_table, "Rank", RANKX ( temp_table, [SericeTotalValue] ) ),
            [Rank] = 1
        ), FILTER(CROutages,CROutages[Date].[Year] = 2020)
    )


Paul Zheng
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

4 REPLIES 4
V-pazhen-msft
Community Support
Community Support

@dcg38524

Prueba algo como esto:

Top Service = 
VAR temp_table =
    SUMMARIZE (
        ALL ( CROutages[Service] ),
        CROutages[Service],
        "SericeTotalValue", COUNTA( CROutages[IDkey] )    
    )
RETURN
    CALCULATE (
        MAX ( CROutages[Service] ),
        FILTER (
            ADDCOLUMNS ( temp_table, "Rank", RANKX ( temp_table, [SericeTotalValue] ) ),
            [Rank] = 1
        ), FILTER(CROutages,CROutages[Date].[Year] = 2020)
    )


Paul Zheng
Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Gracias Paul, apreciamos su ayuda y por responsing tan rápidamente su solución funcionó muy bien 😀.

Saludos

Don

amitchandak
Super User
Super User

@dcg38524, Lo mejor que puedo pensar.

Top Service = 
VAR temp_table =
    SUMMARIZE (
        filter(ALL ( CROutages[Service] ),year(CROutages[Date])=Year(today())),
        CROutages[Service],
        "SericeTotalValue", COUNTA( CROutages[IDkey] )    
    )
RETURN
    CALCULATE (
        MAX ( CROutages[Service] ),
        FILTER (
            ADDCOLUMNS ( temp_table, "Rank", RANKX ( temp_table, [SericeTotalValue] ) ),
            [Rank] = 1
        )
 
    )

Aprecia tus Felicitaciones.

TomMartens
Super User
Super User

Hola @dcg38524 ,

puede crear un archivo pbix que contenga algunos datos de ejemplo pero que aún refleje su modelo de datos, cargue el pbix en onedrive o dropbox y comparta el enlace.
Describa el resultado esperado y cómo el filtrado para el año 2020 afectará al resultado.

saludos
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.