Forum Discussion
Column order within Power Query is not reflected in Model or Datasheet views (bug?)
Here are screenshots of the 3 different versions, sorry some are a bit small but if you zoom in you should be able to see none are the same:
Final step of query:
Datasheet:
Model:
Hi TeeGee ,
Based on my research, data fields are always in alphabetical order in Dataset. It's default behavior by design. But you can find a workaroud using [Sort by other column] feature in this post: https://community.powerbi.com/t5/Desktop/Order-in-fields-pane/td-p/45442
The column order can be controlled in Power Query Editor using "ReorderColumn" function or drag the column. But the order of column is only meaningful in the Power Query Editor and will not effect the order in dataset or the field.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- TeeGee6 years agoHelper II
> The column order can be controlled in Power Query Editor using "ReorderColumn" function or drag the column. But the order of column is only meaningful in the Power Query Editor and will not effect the order in dataset or the field.
I think you must misunderstand what I'm saying, because this simply is not true.
https://datachant.com/2017/01/18/power-bi-pitfall-4/
> The only view in Power BI Desktop where you can see the correct column order is the Data view.
Dong, I see your name contains "Community Support Team", do you work for Microsoft? If so, I think you should forward this thread to your manager, because this is clearly a bug, perhaps it only occurs rarely, but it's a pretty big deal so I think the developers would like to have access to a situation where it is happening to help them diagnose the underlying problem.
- v-lid-msft6 years agoCommunity Support
Hi TeeGee ,
I apologize for misunderstanding your situation, Now I have resized my answer:
Firstly I think you have konw that the column order in Model View and File Pane will be in alphabitbetical order and can not be effected by order in Power Query Editor.
So the left problem is the order in Data View and Power Query Editor, The article you provided in the first mentioned that:
You can control the order of columns in a table in the Power Query Editor but it’s not completely straightforward to get any changes to column order you make in your queries to be applied to the order of the columns in a table after it has already been loaded into a dataset.
The workaround in this article works fine on my side.
1. Change the column order in Power Query Editor
2. Apply changes
3. Disclick "enable load" and Continue
(Notice that will break any visuals that use this table any lost all measures or calculated columns associated with this table.)4. Apply changes
5. Click "enable load"
6. Apply changes
7. Refresh the data.
I guess this workaround have no effect because you miss the step 4 ?
The reason why data view cannot read the order defined in Power Query Editor automatically seems hard to understand , If the workaround still useless on your side, We suggest you to open a ticket here for help if you are a pro user: https://powerbi.microsoft.com/en-us/support/
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- TeeGee6 years agoHelper II
> I guess this workaround have no effect because you miss the step 4 ?
Well yes, because that will break any visuals that use this table any lost all measures or calculated columns associated with this table.
It's fairly useless to be able to reorder columns in PQ if it isn't reflected anywhere else in the model. It's mind boggling that this standard behavior isn't available in Power BI.