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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
vin26
Resolver I
Resolver I

Conseguir error en Clasificación en el filtro de fecha

Hola

No puedo obtener la clasificación adecuada en un conjunto de datos simple. Tengo valores de fecha, país y proyección, por favor encuentre la captura de pantalla a continuación:

rank_issue.JPG

Por favor, ayúdame a obtener la clasificación dinámica basada en la selección del filtro de fecha.

2 ACCEPTED SOLUTIONS

Hola @vin26 ,

Perdón por volver tarde.

Intente crear una tabla de fechas y utilice su columna como segmentación de datos. Modifiqué la fórmula, por favor inténtelo de nuevo.

Date = CALENDAR(MIN(country_projection[date]),MAX(country_projection[date]))
Measure 2 =
RANKX (
    ALLSELECTED ( country_projection ),
    CALCULATE (
        SUM ( country_projection[projection] ),
        FILTER (
            ALLEXCEPT ( country_projection, country_projection[country] ),
            country_projection[date] >= MIN ( 'Date'[Date] )
                && country_projection[date] <= MAX ( 'Date'[Date] )
        )
    ),
    ,
    DESC,
    DENSE
)

v-xuding-msft_0-1598344678367.png

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hola @v-xuding-msft Muchas gracias por la solución, esto funciona bien. ¡Excelente!

También tengo otra lógica que también funciona para mi requisito:

SumCountry = SUM(country_projection[projection])

RankCountry = IF(
    ISFILTERED(country_projection[date]),
        RANKX(
            ALLSELECTED(country_projection[country]),[SumCountry],,DESC,Skip
            )
    )

View solution in original post

17 REPLIES 17
v-xuding-msft
Community Support
Community Support

Hola @vin26 ,

Por favor, intente esto:

Measure 2 =
RANKX (
    ALLSELECTED ( country_projection ),
    CALCULATE (
        SUM ( country_projection[projection] ),
        ALLEXCEPT ( country_projection, country_projection[country] )
    ),
    ,
    DESC,
    DENSE
)

v-xuding-msft_0-1597903516244.png

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hola @v-xuding-msft Gracias por la sugerencia, funciona para el pequeño origen de datos, cuando cargo los datos reales (tamaño 30k filas) y la selección del intervalo de fechas, rango no se muestra correctamente. Pero funciona sin ninguna selección de fecha.

con selección de intervalo de fechas

Ranking3.JPG

selección de toda la selección de fecha:

ranking4.JPG

Hola @vin26 ,

Perdón por volver tarde.

Intente crear una tabla de fechas y utilice su columna como segmentación de datos. Modifiqué la fórmula, por favor inténtelo de nuevo.

Date = CALENDAR(MIN(country_projection[date]),MAX(country_projection[date]))
Measure 2 =
RANKX (
    ALLSELECTED ( country_projection ),
    CALCULATE (
        SUM ( country_projection[projection] ),
        FILTER (
            ALLEXCEPT ( country_projection, country_projection[country] ),
            country_projection[date] >= MIN ( 'Date'[Date] )
                && country_projection[date] <= MAX ( 'Date'[Date] )
        )
    ),
    ,
    DESC,
    DENSE
)

v-xuding-msft_0-1598344678367.png

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hola @v-xuding-msft Muchas gracias por la solución, esto funciona bien. ¡Excelente!

También tengo otra lógica que también funciona para mi requisito:

SumCountry = SUM(country_projection[projection])

RankCountry = IF(
    ISFILTERED(country_projection[date]),
        RANKX(
            ALLSELECTED(country_projection[country]),[SumCountry],,DESC,Skip
            )
    )

Daviejoe
Memorable Member
Memorable Member

En caso de duda, echa un vistazo a lo que Marco & Alberto dicen

https://www.daxpatterns.com/ranking/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




vin26
Resolver I
Resolver I

@amitchandak @harshnathani @Daviejoe @Pragati11 gracias a todos por la rápida respuesta. Traté de todas las sugerencias, pero todavía no funciona. He intentado por debajo de la medida con 'ALLEXCEPT, funciona un poco, pero la clasificación todavía no es correcta!!

ranking.JPG

Tengo sólo 3 en columnas de datos de origen, fecha, país y proyección. Por favor, hágamelo saber si tiene alguna sugerencia.

Hola @vin26 ,

Comparta algunos datos de ejemplo en formato de texto.

saludos
Harsh Nathani
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución! Apreciar con un Kudos!! (Haga clic en el botón Pulgares arriba)

Hola @vin26 ,

¿Puedes compartir la captura de pantalla cuando probaste nuestro método de usar ALLSELECTED y cuál es la salida que obtienes?

¿Has probado esto:

Rank á RANKX(ALLSELECTED(country_projection), CALCULATE(SUM(country_projection[projection])),, DESC, Dense)

Gracias

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@Pragati11 Hola Pragati, aquí está

ranking2.JPG

hola @vin26 ,

El scresnhot simplemente no me ayuda con ninguna descripción de por qué está mal.

¿Por qué crees que está mal? ¿Qué espera como salida al filtrar la fecha?

Gracias

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hola @Pragati11 en la captura de pantalla adjunta 'Proyecciones' se ordenan en orden descendente, mi expectativa es obtener la clasificación en 1,2,3,4,... orden, pero si ves la medida 'Rank' muestra 1,1,1,1,1...

ranking2.JPG

Hola @vin26 ,

Comparta algunos datos de ejemplo para que podamos intentar replicar el problema.

Gracias

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@Pragati11 Por favor, encuentre el archivo de muestra en el siguiente enlace, hay 30K filas de datos, lo he reducido a 1k

https://www.dropbox.com/s/qphhj10lu5qjta7/Ranking.pbix?dl=0

amitchandak
Super User
Super User
harshnathani
Community Champion
Community Champion

hola @vin26 ,

Prueba esta medida

Medida: RANKX(ALLSELECTED( Country_projection[Country], Country_projection[projection]), CALCULATE(SUM(Country[projection)),,DESC)

saludos
Harsh Nathani
¿He respondido a tu pregunta? ¡Marca mi puesto como una solución! Apreciar con un Kudos!! (Haga clic en el botón Pulgares arriba)

Daviejoe
Memorable Member
Memorable Member

Rango de Rango (Rank)

RANKX (

ALLSELECTED (

CALCULATE ( SUM (country_projection[proyección de país])),

DESC)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Pragati11
Super User
Super User

Hola @vin26 ,

Intente usar ALLSELECTED en su DAX en lugar de ALL.

Gracias

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors