Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

after union two table, data go to wrong column

when I union two same table, most data go to wrong column,  who know how to fix this error, thank you
  • v-yulgu-msft's avatar
    v-yulgu-msft
    8 years ago

    Hi Anonymous,

     

    You could modify the DAX for calculated table as:

    Result Table =
    UNION (
        SELECTCOLUMNS (
            Table1,
            "Column1", Table1[Column1],
            "Column2", Table1[Column2],
            "Column3", Table1[Column3]
        ),
        SELECTCOLUMNS (
            Table2,
            "Column1", Table2[Column1],
            "Column2", Table2[Column2],
            "Column3", Table2[Column3]
        )
    )

    That way can keep the same order for columns when you union two tables.

     

    Regards,

    Yuliana Gu