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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
monishd
Frequent Visitor

Merge a table 2 times to another table to get 2 different columns

Is there a more straightforward way to merge two tables two times with different columns and get new columns based on the match? Can I achieve the below result in one merge or will I have to go for two merge?

 

I have a table 1:

ItemOpenedClosed

I1

XYZXYZ
I2ABCXYZ
I3PQRPQR
I4PQRXYZ

 

table 2:

EmployeeType
ABCManual
PQRSystem
XYZ

System

 

The new table I want should be like:

ItemOpened

Opened By

ClosedClosed By

I1

XYZSystemXYZSystem
I2ABCManualXYZSystem
I3PQRSystemPQRSystem
I4PQRSystemABCManual
1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @monishd 

 

please check if this accomodate your need.

 

based on the result table your show, i think you want to find a 'Type' value based on matched 'Employee' value (not table merge).

 

But please correct me if i am wrong (since i am not sure why I4 has ABC in 'ByClosed' instead of XYZ as shown in 'Table 1').

 

1. in your table 1, create a calculated column for 'Opened by' with following DAX.

Opened by = 
MAXX(
    FILTER(
        'Table 2',
        'Table 1'[Opened]='Table 2'[Employee]
    ),
    'Table 2'[Type]
)
Irwan_0-1724892481970.png

 

2. again, create a calculated column for 'Closed by' with following DAX.

Closed by =
MAXX(
    FILTER(
        'Table 2',
        'Table 1'[Closed]='Table 2'[Employee]
    ),
    'Table 2'[Type]
)

Irwan_1-1724892549437.png

 

Hope this will help.

Thank you.

View solution in original post

1 REPLY 1
Irwan
Super User
Super User

hello @monishd 

 

please check if this accomodate your need.

 

based on the result table your show, i think you want to find a 'Type' value based on matched 'Employee' value (not table merge).

 

But please correct me if i am wrong (since i am not sure why I4 has ABC in 'ByClosed' instead of XYZ as shown in 'Table 1').

 

1. in your table 1, create a calculated column for 'Opened by' with following DAX.

Opened by = 
MAXX(
    FILTER(
        'Table 2',
        'Table 1'[Opened]='Table 2'[Employee]
    ),
    'Table 2'[Type]
)
Irwan_0-1724892481970.png

 

2. again, create a calculated column for 'Closed by' with following DAX.

Closed by =
MAXX(
    FILTER(
        'Table 2',
        'Table 1'[Closed]='Table 2'[Employee]
    ),
    'Table 2'[Type]
)

Irwan_1-1724892549437.png

 

Hope this will help.

Thank you.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors