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

La medida no devuelve la fecha mínima

Hola

Estoy intentando crear una medida que devuelva la fecha mínima si dos o más registros tienen el mismo ID y AuthorisationType es igual a 2 u 11. Escribí una medida que es la siguiente:

Min Date = CALCULATE(Min(Table[EffectiveDate]),FILTER(Table,Table[ID] = MAX(Table[ID]) &&(Max(Table[AuthorisationTypeID]) = 11 || Max(Table[AuthorisationTypeID]=2))))

La medida anterior no devuelve el resultado deseado. Por ejemplo, como se muestra en la siguiente imagen, el ID de registro 108644 tiene dos fechas y la medida no devolvió la fecha mínima.

leo_89_0-1632882716965.png

¿Alguien podría ayudarme donde cometí el error?

Archivo de muestra aquí

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Hola

Arrastre el ID al objeto visual y escriba esta medida:

Fecha mínima = CALCULATE(Min(Table[EffectiveDate]),Table[AuthorisationTypeID] = 11 || Tabla[AuthorisationTypeID]=2)

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@leo_89 por favor pruebe esto

Measure3 = 
MINX (
    FILTER ( 'Table', 'Table'[AuthorisationTypeID] IN { 2, 11 } ),
    VAR _0 =
        CALCULATE ( MAX ( 'Table'[ID] ) )
    VAR _1 =
        CALCULATE ( MIN ( 'Table'[EffectiveDate] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) )
    VAR _2 =
        CALCULATE (
            MIN ( 'Table'[EffectiveDate] ),
            TREATAS ( { ( { _0 }, { _1 } ) }, 'Table'[ID], 'Table'[EffectiveDate] )
        )
    RETURN
        _2
)

smpa01_0-1632885472519.png

Syndicate_Admin
Administrator
Administrator

Hola

Arrastre el ID al objeto visual y escriba esta medida:

Fecha mínima = CALCULATE(Min(Table[EffectiveDate]),Table[AuthorisationTypeID] = 11 || Tabla[AuthorisationTypeID]=2)

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.