Forum Discussion

GooseHelpful199's avatar
3 years ago
Solved

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.

 

 

 

  • Hi,

    in power query you append the two queries as New

    then merge your columns

    and finally remove duplicates

    and you obtain your result

    In dax you can create a calculated table

    Table = DISTINCT(UNION(Query1,Query2))
     and obtain 

    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 !

     

     

     

     

     

  • Hi,

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

3 Replies

  • Hi,

    in power query you append the two queries as New

    then merge your columns

    and finally remove duplicates

    and you obtain your result

    In dax you can create a calculated table

    Table = DISTINCT(UNION(Query1,Query2))
     and obtain 

    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 !

     

     

     

     

     

  • Hi,

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