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
GlynMThomas
Resolver I
Resolver I

Max group por id y clave de fecha

Hola, chicos

Tengo una mesa que se ve así:

Identificador del grupo de informesMétodo de inversiónClave de fechaValor
1Interna2020010150
1Externos20200101100
1Interna20200201100
1Externos2020020120
1Interna20200301500
2Interna20200101500
2Externos20200101200
2Interna20200201300
2Externos2020020150
3Interna20200101400
3Externos20200101200
3Interna20200201100
3Externos20200201300

Necesito crear una tabla verani estandarizada que me proporcione solo el método de inversión del grupo de informes para cada clave de fecha en función del valor máximo de cada fecha. Así que los resultados deberían tener este aspecto:

Identificador del grupo de informesMétodo de inversiónClave de fechaValor
1Externos20200101100
1Interna20200201100
1Interna20200301500
2Interna20200101500
2Interna20200201300
3Interna20200101400
3Externos20200201300

Estoy un poco atascado.

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hola @GlynMThomas

Puede crear una tabla de resumen para mostrar el valor máximo para cada ID y clave de fecha por función de resumen.

Summarize Table = 
SUMMARIZE (
    FILTER (
        'Table',
        'Table'[Reporting Group Id ] = 'Table'[Reporting Group Id ]
            && 'Table'[Date Key] = 'Table'[Date Key]
            && 'Table'[Value]
                = MAXX (
                    FILTER (
                        'Table',
                        'Table'[Reporting Group Id ] = EARLIER ( 'Table'[Reporting Group Id ] )
                            && 'Table'[Date Key] = EARLIER ( 'Table'[Date Key] )
                    ),
                    'Table'[Value]
                )
    ),
    'Table'[Reporting Group Id ],
    'Table'[Investment Method ],
    'Table'[Date Key],
    'Table'[Value]
)

El resultado es el siguiente.

1.png

Puede descargar el archivo pbix desde este enlace: Max group by id and date key

Saludos

Rico Zhou

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

2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hola @GlynMThomas

Puede crear una tabla de resumen para mostrar el valor máximo para cada ID y clave de fecha por función de resumen.

Summarize Table = 
SUMMARIZE (
    FILTER (
        'Table',
        'Table'[Reporting Group Id ] = 'Table'[Reporting Group Id ]
            && 'Table'[Date Key] = 'Table'[Date Key]
            && 'Table'[Value]
                = MAXX (
                    FILTER (
                        'Table',
                        'Table'[Reporting Group Id ] = EARLIER ( 'Table'[Reporting Group Id ] )
                            && 'Table'[Date Key] = EARLIER ( 'Table'[Date Key] )
                    ),
                    'Table'[Value]
                )
    ),
    'Table'[Reporting Group Id ],
    'Table'[Investment Method ],
    'Table'[Date Key],
    'Table'[Value]
)

El resultado es el siguiente.

1.png

Puede descargar el archivo pbix desde este enlace: Max group by id and date key

Saludos

Rico Zhou

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

DataInsights
Super User
Super User

@GlynMThomas,

Pruebe esta medida:

Max Value =
VAR vReportingGroup =
    MAX ( GroupTest[Reporting Group Id] )
VAR vDateKey =
    MAX ( GroupTest[Date Key] )
VAR vMaxValue =
    CALCULATE (
        MAX ( GroupTest[Value] ),
        FILTER (
            ALL ( GroupTest ),
            GroupTest[Reporting Group Id] = vReportingGroup
                && GroupTest[Date Key] = vDateKey
        )
    )
VAR vResult =
    IF ( MAX ( GroupTest[Value] ) = vMaxValue, vMaxValue, BLANK () )
RETURN
    vResult

DataInsights_0-1606105214527.png





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

Proud to be a Super User!




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.