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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
bideveloper555
Helper IV
Helper IV

Columnas de unión en la misma tabla con función Min/Max

Hola

A continuación se muestran los datos de ejemplo.

Quiero hacer unión en la misma tabla para 3column una tabla (id,opendate,Status) como la tabla 1 y (ID,CloseDate,Status) como la tabla 2.

Unión

Filtrar tabla 1 con estado - Nuevo y min en fecha abierta

y filtrar el estado de la tabla2 - Cerrado y min en ClosedDate

IdOpenDateEstadoClosedDateTestDate
101/09/2019Nuevo
1 Cerrado01/10/2019
101/09/2019Prueba01/10/201905/09/2019
IdFechaEstado
101/09/2019Nuevo
101/10/2019Cerrado

Gracias

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hola @bideveloper555 ,

Puede intentar crear una tabla calculada por Nueva tabla en Cálculos.

NewTable =
VAR table1 =
    SELECTCOLUMNS (
        FILTER (
            'Table',
            [Status] = "New"
                && [OpenDate] = CALCULATE ( MIN ( 'Table'[OpenDate] ), ALL ( 'Table' ) )
        ),
        "ID", [ID],
        "Date", [OpenDate],
        "Status", [Status]
    )
VAR table2 =
    SELECTCOLUMNS (
        FILTER (
            'Table',
            [Status] = "Closed"
                && [ClosedDate] = CALCULATE ( MIN ( 'Table'[ClosedDate] ), ALL ( 'Table' ) )
        ),
        "ID", [ID],
        "Date", [ClosedDate],
        "Status", [Status]
    )
RETURN
    UNION ( table1, table2 )

4.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

2 REPLIES 2
Anonymous
Not applicable

Hola @bideveloper555 ,

Puede intentar crear una tabla calculada por Nueva tabla en Cálculos.

NewTable =
VAR table1 =
    SELECTCOLUMNS (
        FILTER (
            'Table',
            [Status] = "New"
                && [OpenDate] = CALCULATE ( MIN ( 'Table'[OpenDate] ), ALL ( 'Table' ) )
        ),
        "ID", [ID],
        "Date", [OpenDate],
        "Status", [Status]
    )
VAR table2 =
    SELECTCOLUMNS (
        FILTER (
            'Table',
            [Status] = "Closed"
                && [ClosedDate] = CALCULATE ( MIN ( 'Table'[ClosedDate] ), ALL ( 'Table' ) )
        ),
        "ID", [ID],
        "Date", [ClosedDate],
        "Status", [Status]
    )
RETURN
    UNION ( table1, table2 )

4.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.

amitchandak
Super User
Super User

@bideveloper555 , Probar algo como

sindicato(
resume(filter(Table,not(isblank(table[OpenDate]))), table[ID], table[OpenDate])
resume(filter(Table,not(isblank(table[closeDate]))), table[ID], table[closeDate])
)

Proporcione sus comentarios y consejos para nuevos videos
Tutorial Series Dax Vs SQL Direct Query PBI Consejos
Apreciamos tus Felicitaciones.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors