Forum Discussion

Ankit041's avatar
Ankit041
Frequent Visitor
9 years ago
Solved

Merge queries

I am trying to merge two queries with 4 matching columns. The result query is containing two new columns(one from the secondary and other from the primary table again) apart from the primary table.Please suggest me what to do

  • Ankit041's avatar
    Ankit041
    9 years ago

    One of the matching columns doesn't have any data i.e 'blank' . I removed that column from the table itself and then joined them . After that even though I am including that column I am still getting the desired output(no duplicate columns fromn the same table),surprising isn't it. 

     

    Tools works in weird way some time. Can't believe I spend so much time on this and still dont know the root cause even though I am getting desired results.

9 Replies

  • Hi there if I understand correctly you could then remove the columns that you no longer need.

    Also ensure when you are merging the data that you choose the columns in the same order from each table.
    • Ankit041's avatar
      Ankit041
      Frequent Visitor

      I am adding the columns in the order as they are supppose to be.Yes I can remove the unwanted columns but I just dont understand why it is happening. There is one column in which there is no data. I guess that could be the resaon .  I want to understand how the power bi queries works exactly.

      • GilbertQ's avatar
        GilbertQ
        Super User
        Hi there, it works a lot like a TSQL query when you are doing a right, left, inner, outer and full joins. So depending on the join that you select will be reflected in the output.

        Do you have any images that you can show when you are doing the joins and then the output?

        Will be easier to see what is happening.