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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tomwolswijk
Helper I
Helper I

Fecha de clasificación en PowerBI

Hola

Estoy buscando un formule DAX para clasificar la fecha kolomn. No hay filtros adicionales en el cliente ect, sólo clasificar la fecha.

Cada mes se cargan nuevos datos en el modelo PowerBI. Ahora quiero añadir un Kolomn para que 1 meses más nuevos, 2 meses antes, etc. ¿Puede alguien ayudarme en esto?

Mesa:

MesClienteCantidad
jan-201100
feb-201122
feb-2011
mar-201140

Resultado:

MesClienteCantidadrango
jan-2011003
feb-2011222
feb-20112
mar-2011401
1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hola @tomwolswijk ,

Puede probar esta columna calculada.

Rank = 
RANKX (
    'Table',
    RANKX ( 'Table', YEAR ( 'Table'[Date] ),, DESC, DENSE ) * 100
        + RANKX ( 'Table', MONTH ( 'Table'[Date] ),, DESC, DENSE ),
    ,
    ASC,
    DENSE
)

6.png

Puede consultar más detalles desde aquí.

Saludos

Stephen Tao

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

View solution in original post

7 REPLIES 7
Marlow
New Member

Gracias

v-stephen-msft
Community Support
Community Support

Hola @tomwolswijk ,

Puede probar esta columna calculada.

Rank = 
RANKX (
    'Table',
    RANKX ( 'Table', YEAR ( 'Table'[Date] ),, DESC, DENSE ) * 100
        + RANKX ( 'Table', MONTH ( 'Table'[Date] ),, DESC, DENSE ),
    ,
    ASC,
    DENSE
)

6.png

Puede consultar más detalles desde aquí.

Saludos

Stephen Tao

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

¡Muchas gracias! ¡Funcionó!

Usé 'Table'[Month] en lugar de 'Table'[Date], porque month ya es un tipo de datos de fecha. ¡Gracias!

Lo intenté;

Rango de Rango (Rank)
RANKX( (
ALLSELECTED ( Tabla[Mes] ),
CALCULATE ( SELECTEDVALUE ( Tabla[Mes] ) ),
,
Asc
))
Pero no funcionó... ¿Puedes ayudar?

@tomwolswijk, creé una medida y luego usé Rank

Measure = CALCULATE(SUM('Table (2)'[Amount]) ,ALLEXCEPT('Table (2)','Table (2)'[Month]))
Measure 2 = rankx(ALL('Table (2)'[Month]),[Measure])

La medida que dio es clasificar [Cantidad]. Pero sólo quiero dar a mi valor de fecha un rango basado en la fecha, sin usar otras variables.

Para hacerlo simple:

Mesrango
01-12-20195
01-01-20204
01-02-20203
01-04-20202
01-06-20201

Gracias por tu ayuda

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.