Forum Discussion

dgbraqe's avatar
dgbraqe
Frequent Visitor
8 years ago
Solved

Append table lost rows

Hi, I'm having a problem loading two queries from different bases and merging them using the "Append as new" option. The resulting table is joining records incorrectly, following examples:

 

Base 1 - 33866 rows. Colunm ChavePedido (33866 distinct values)
Base 2 - 76326 rows. Colunm ChavePedido (76326 distinct values)
Base Append - 110192 rows. Colunm ChavePedido (110107 distinct values)

 

The result in the Append base should be 110192 distinct lines, mirroring base 1 and base 2. How to make Append correct?

22 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    dgbraqe,

    Do you have duplicated values in ChavePedido column of Base 1 and Base 2 tables? For example, value A exists both in Base 1 and Base 2.

    Based on your third screenshot, there are 110192 rows in the append table, which is correct. But for the  Colunm ChavePedido, there are 110107 distinct values.

    Regards,
    Lydia

    • dgbraqe's avatar
      dgbraqe
      Frequent Visitor

      No, I do not have duplicate ChavePedido values. This field is unique in each database, to ensure that after joining the bases do not match, I use a "source" numbering to do the composition of this key. Still to make sure they do not duplicate, I also exported the data from each database to Excel and checked duplicity.

      • Anonymous's avatar
        Anonymous
        Not applicable

        dgbraqe,

        What version of Power BI Desktop do you use? Is there any possibility that you can share us the sample data of your tables?

        Regards,
        Lydia

  • Anonymous's avatar
    Anonymous
    Not applicable

    dgbraqe,

    Create a new append  table using DAX below and you should get correct distinct values.

    Table = UNION('BASE 1','BASE 2')

    Regards,
    Lydia

    • edhans's avatar
      edhans
      Community Champion

      Anonymous wrote:

      dgbraqe,

      Create a new append  table using DAX below and you should get correct distinct values.

      Table = UNION('BASE 1','BASE 2')

      Regards,
      Lydia


      Isn't that a workaround? Why isn't it working correctly, or at least, why aren't we understanding it correctly, in the M code?

    • dgbraqe's avatar
      dgbraqe
      Frequent Visitor

      edhans, perfect your observation.

       

      When we use the DAX function, the problem does not occur.
      This shows even more that we have a problem with the M (Power Query) language, I understand that the use of "Table.combine" (M language) or "UNION" (DAX language) should have the same result.

      I opened a ticket with Microsoft, I will inform you as soon as I have a definitive answer.

       

      Anonymous, please, leave the topic open until we understand the reason for the difference between the M and DAX language.

  • It's now 2022 and I have same issue as laid out here in this thread. If I combine two tables in Power Query it will not actually have the contents of both tables, but if I do the DAX combine it will. The problem with that though is I need the append to work in Power Query because I need to do some other work with that appended table, when it is DAX it is not available in Power Query.

     

    Does anyone have other ideas to get this to work in Power Query? I have the latest December 2021 update of Power BI and this issue still exists.