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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
bideveloper555
Helper IV
Helper IV

Union Columns in Same table with Min/Max function

hi

Below is sample data.

I want to do union on same table for 3column a table(id,opendate,Status) as table 1 and (ID,CloseDate,Status) as table 2.

Union 

Filter table 1 with status = New and min on opendate

and filter table2 status = Closed and min on ClosedDate

 

 

IDOpenDateStatusClosedDateTestDate
101/09/2019New  
1 Closed01/10/2019 
101/09/2019Test01/10/201905/09/2019
     
     
     
IDDatestatus  
101/09/2019New  
101/10/2019Closed  

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @bideveloper555 ,

 

You may try to create a calculated table by New table Under Calculations.

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

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @bideveloper555 ,

 

You may try to create a calculated table by New table Under Calculations.

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

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@bideveloper555 , Try something like

union(
summarize(filter(Table,not(isblank(table[OpenDate]))), table[ID], table[OpenDate])
summarize(filter(Table,not(isblank(table[closeDate]))), table[ID], table[closeDate])
)

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.