Forum Discussion

SYM1986's avatar
SYM1986
Helper I
5 years ago
Solved

Column order in data view

Hi all,

I have a report,after  i load the data soure. There are five queries,2017,2018,2019,2020, 2021.

These queries have the same column order in power query.But afer i apply the querie,four of them have change their column order in the data view, Thie cause the dax ‘union’ failed.(see the following photos)

The 2021 have the same colum order in the data source and the power query,(2017,2018,2019,2020, change the column order),i only do the same action of remove colum in power query, and after the action they have the same column order.

Can anyone help to tell me why it show this in data view and how to fix this?

thank you

 

  • With UNION function, columns are combined by position in their respective tables.


    If you want to combine multiple queries into a query, you can also use Append queries in Power Query Editor as an alternative which are combined by column headers.

     

    Regards,
    Community Support Team _ Jing

5 Replies

  • SYM1986 , does column order matter for you here(date studio)?

    It can change based on the order columns are added or removed.

    You may have to check all steps in advance editor (right-click in power query on the table and open it)

     

    • SYM1986's avatar
      SYM1986
      Helper I

      Hi amitchandak , it affect the DAX of union.

      The steps in advance editor now are same, but the queries were added in each year,  so i adjusted some steps before 2021.

      I delete all the queries, and reload all the datas, now they have the same order.

      thank you.

      • amitchandak's avatar
        amitchandak
        Super User

        SYM1986 , DAX union can have an impact. You have to use select columns in that case,

         

        But best was what you have done.

         

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    With UNION function, columns are combined by position in their respective tables.


    If you want to combine multiple queries into a query, you can also use Append queries in Power Query Editor as an alternative which are combined by column headers.

     

    Regards,
    Community Support Team _ Jing