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
kathraji
Frequent Visitor

DAX Obtener el último valor con de otro tableau basado en la condición

Hola a todos,

Tengo dos tablas A y B con los siguientes datos. Estoy tratando de tener una tabla con el último valor fr code'0' para cada nombre

Tabla A

NombreCódigo
nombre11
nombre21
nombre31

TableB

NombreCódigoupdated_at
nombre1010/12/2017
nombre1015/12/2017
nombre2007/1/2020
nombre2025/1/2020
nombre3019/04/2020

A la tabla resultante le gustaría esto

NombreCódigoupdated_at
nombre11
nombre1015/12/2017
nombre21
nombre2025/1/2020
nombre31
nombre3019/04/2020

Por favor, ayúdenme.

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

Hola @kathraji ,

Es una ligera modificación de la respuesta de amitchandak:

Table =
UNION (
    SUMMARIZE (
        TableB,
        TableB[name],
        TableB[code],
        "updated_at", MAX ( TableB[updated_at] )
    ),
    ADDCOLUMNS ( TableA, "updated_at", BLANK () )
)

Capture2.PNG

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

Saludos

Dedmon Dai

View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hola @kathraji ,

Es una ligera modificación de la respuesta de amitchandak:

Table =
UNION (
    SUMMARIZE (
        TableB,
        TableB[name],
        TableB[code],
        "updated_at", MAX ( TableB[updated_at] )
    ),
    ADDCOLUMNS ( TableA, "updated_at", BLANK () )
)

Capture2.PNG

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

Saludos

Dedmon Dai

amitchandak
Super User
Super User

@kathraji, vea si esto puede funcionar

sindicato (
summarize(Table2, Table[name code],"updated_at" , max(updated_at)),
addcolumns(Tabla A,"updated_at" ,blank())
)

recomienda

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

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.