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

Can I combine columns from multiple queries? (Stack, not concatenate)

I have two different columns with a list of codes (with overlap and duplicates) I want to combine into one large list with all the results. If I have Column1 and Column2 existing in 2 separate queries, how would I go about creating a new query that combines these two columns into one, while removing duplicates?

Looking for a solution that would work assuming that the real values of Column1 and Column2 are actually Custom Columns made in Power Query, since they are really concatenated keys.

GooseHelpful199_3-1665693938503.png

 

 

 

2 ACCEPTED SOLUTIONS
serpiva64
Solution Sage
Solution Sage

Hi,

in power query you append the two queries as New

serpiva64_0-1665696284286.png

then merge your columns

serpiva64_1-1665696377825.png

and finally remove duplicates

serpiva64_2-1665696418518.png

and you obtain your result

serpiva64_3-1665696471589.png

In dax you can create a calculated table

Table = DISTINCT(UNION(Query1,Query2))
 and obtain 
serpiva64_4-1665696659396.png

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

 

 

 

 

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Ensure that the headings in both tables are the same.  In the Query Editor, append the two tables and then Remove Duplicates.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Ensure that the headings in both tables are the same.  In the Query Editor, append the two tables and then Remove Duplicates.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
serpiva64
Solution Sage
Solution Sage

Hi,

in power query you append the two queries as New

serpiva64_0-1665696284286.png

then merge your columns

serpiva64_1-1665696377825.png

and finally remove duplicates

serpiva64_2-1665696418518.png

and you obtain your result

serpiva64_3-1665696471589.png

In dax you can create a calculated table

Table = DISTINCT(UNION(Query1,Query2))
 and obtain 
serpiva64_4-1665696659396.png

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

 

 

 

 

Thank you for the detailed screenshots, this worked perfectly!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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