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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
vibhoryadav23
Helper II
Helper II

Need a new table with unique values and merging multiple tables

Hi,

I need to combine values from multiple tables where I pull the unique values from a column from all the tables and then combine them. For example:

 

Table A   
RegionCountryConcatColumnX
MEUAEMEUAE1
NAUSANAUSA1
LAChileLAChile2
LAArgentinaLAArgentina2

 

Table B   
RegionCountryConcatExample2
APACIndiaAPACIndian
MEUAEMEUAEy
NACanadaNACanaday
LAArgentinaLAArgentinay

 

Output table  
Concat (Unique)RegionCountry
MEUAEMEUAE
NAUSANAUSA
LAChileLAChile
LAArgentinaLAArgentina
APACIndiaAPACIndia
NACanadaNACanada

 

Can you please help me with this? Thanks in advance.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @vibhoryadav23 ,

 

Is this table you want to achieve?

vmengzhumsft_0-1658397955927.png

The following is process of my testing:

 

1.Open power query and append the two tables

vmengzhumsft_1-1658397955928.png

 

You can get this table

vmengzhumsft_2-1658397955930.png

2.Remove the column you don’t want to:

vmengzhumsft_3-1658397955932.png

3.After modifying the order between the columns, right-click on the first column and select “Remove Duplicates”, finally you can get the following table as you want to achieve.

vmengzhumsft_4-1658397955932.png

 

Best regards,

Community Support Team Selina zhu

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

5 REPLIES 5
Anonymous
Not applicable

Hi @vibhoryadav23 ,

 

Is this table you want to achieve?

vmengzhumsft_0-1658397955927.png

The following is process of my testing:

 

1.Open power query and append the two tables

vmengzhumsft_1-1658397955928.png

 

You can get this table

vmengzhumsft_2-1658397955930.png

2.Remove the column you don’t want to:

vmengzhumsft_3-1658397955932.png

3.After modifying the order between the columns, right-click on the first column and select “Remove Duplicates”, finally you can get the following table as you want to achieve.

vmengzhumsft_4-1658397955932.png

 

Best regards,

Community Support Team Selina zhu

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

vibhoryadav23
Helper II
Helper II

Hi Vahid,

Thanks for the solution but this doesn't work properly as I have some more columns in data. Is it possible to have just 'Concat (unique)' in the output?
Thanks!

Hi @vibhoryadav23 

 

Yes, Try this:

New Table = 
Var _Union = UNION('Table A','Table B')
return
SUMMARIZE(_Union,[Concat])

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Hi @VahidDM ,

This doesnt work as well. Maybe I was not clear enough but there some extra columns in Table A and B which doesnt match between the tables. I have updated the example above.

vibhoryadav23_0-1658323887748.png

 

Thanks!

VahidDM
Super User
Super User

Hi @vibhoryadav23 

 

Try this code to create a new table with DAX:

New Table = 
Var _Union = UNION('Table A','Table B')
return
SUMMARIZE(_Union,[Concat],[Country],[Region])

 

output:

VahidDM_0-1658191338519.png

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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