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

Combine column value from multiple table

Hi there,

 

I'm seeking your help on how we can creating a new column that combines value from multiple columns from different tables.

In particular, I have at least 2 tables, for example

 

Table 1:

Customer Name |    ID   |     DOB

A                        

B

C

Table 2:

Customer Name |    ID   |     Address

A

B

E

F

 

Expected result: I wanna have the list of unique Customer name from Table 1, Table 2 as well as other tables as below

Customer Name

A

B

C

E

F

 

Thank you for your help!

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @duycao 

You can create a calcualted table that give you the unique list from both tables like so.

 

Combined Table = 
DISTINCT(
    UNION(
        DISTINCT(Table1[Customer Name]),
        DISTINCT(Table2[Customer Name])
    )
)

 

 

You can continue to add the additional source tables in this one calculation.

 

Combined Table = 
DISTINCT(
    UNION(
        DISTINCT(Table1[Customer Name]),
        DISTINCT(Table2[Customer Name]),
        DISTINCT(Table3[Customer Name]),
        DISTINCT(Table4[Customer Name]),
        DISTINCT(Table5[Customer Name])
    )
)

 

 

 

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

The ID fields are the same in both tables? And I understand you want to do it in Power Query?

Best
D
jdbuchanan71
Super User
Super User

Hello @duycao 

You can create a calcualted table that give you the unique list from both tables like so.

 

Combined Table = 
DISTINCT(
    UNION(
        DISTINCT(Table1[Customer Name]),
        DISTINCT(Table2[Customer Name])
    )
)

 

 

You can continue to add the additional source tables in this one calculation.

 

Combined Table = 
DISTINCT(
    UNION(
        DISTINCT(Table1[Customer Name]),
        DISTINCT(Table2[Customer Name]),
        DISTINCT(Table3[Customer Name]),
        DISTINCT(Table4[Customer Name]),
        DISTINCT(Table5[Customer Name])
    )
)

 

 

 

 

Hi there, this works perfectly. Thank you!

Hi @duycao ,

If your problem has been resolved, could you please mark the helpful post as Answered? It will help anyone in the community find the solution easily if they face the same problem with you. Thank you.

Best Regards

Rena

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

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.