Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How can I do Merged Queries for more than two tables?

Hello

 

How can I do Merged Queries for more than two tables? It only allows me to choose two tables. Maybe I should merge the two and then merge the resulting table with the third one and so on?

 

Thanks

  • Hi Anonymous ,

     

    Are you merging or appending?

    Merging is always 2 tables, as you are joining them using either of the following join like INNER, OUTER, etc.

    But, appending is done when you are appending rows from multiple files into ONE single file when the structure of all the files is same. Appending gives you option to append more than 2 files also.

    But, merging doen;t allow that as it uses keys from 2 files to merge data.

     

    If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

     

    Thanks,

    Pragati

  • Hi Anonymous 

    For merge multiple tables you should merge it step-by-step. If you are in Power QueriEditor mode do this action so many times as you need

    For DAX try statement like 

    NATURALLEFTOUTERJOIN ( <LeftTable>, NATURALLEFTOUTERJOIN ( <RightTable>, <TheVeryRightTable> ) )

2 Replies

  • Hi Anonymous ,

     

    Are you merging or appending?

    Merging is always 2 tables, as you are joining them using either of the following join like INNER, OUTER, etc.

    But, appending is done when you are appending rows from multiple files into ONE single file when the structure of all the files is same. Appending gives you option to append more than 2 files also.

    But, merging doen;t allow that as it uses keys from 2 files to merge data.

     

    If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

     

    Thanks,

    Pragati

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    For merge multiple tables you should merge it step-by-step. If you are in Power QueriEditor mode do this action so many times as you need

    For DAX try statement like 

    NATURALLEFTOUTERJOIN ( <LeftTable>, NATURALLEFTOUTERJOIN ( <RightTable>, <TheVeryRightTable> ) )