Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Power BI Data Tables Not Maintaining Column Order

Hi,

 

In Power Query, I sorted a table per the below example:

Column_abc, Column_bcd, Column_cde

 

When I close and load the table and view it in the Data Table view it has a different column order:

Column_bcd, Col_abc, Col_cde

 

Why would the data table change the column order?

 

Additionally, when I copy the table and paste it into Excel it combines all columns as one column despite clearly being 4 separate columns in Power BI. Any ideas why this would happen?

 

Thanks!

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      This solution worked, thanks!

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi, Anonymous

    1. I'm afraid it couldn't achieve that sort the column order in Power BI data pane for now.

    and for column order which you had sorted, you could use the method as LivioLanzo provided.

     

    2. when I copy the table and paste it into Excel it combines all columns as one column despite clearly being 4 separate columns in Power BI.

    After my test, it works well. So please check when you paste it into excel, whether you had paste it into one cell?

     

    Best Regards,

    Lin

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Lin,

       

      Thanks for the reply! After applying Livio's solution, Power BI is now pasting the table into mutliple columns as it should. I am 99% that this was not a user error and is a bug, perhaps one that occurs when a table is split in two, then appended as new and with the sort order changing.

       

      In any event, problem solved, thanks!

  • This worked for me: Click on Table > Transform > Advance Editor . Add a line called "Table.ExpandableColumn(Your column names seperated by a ,") 

    This should order the columns how you want it.  (I wanted the Area Code to appear before Area Name in Table view)