cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
girishks90
Frequent Visitor

Table.ReorderColumns Not Working

Hello,

 

I tried using the Table.ReorderColumns in Power Query and can see that it works in the Query Editor window. But when the table is loaded, the columns in "Data View" are in some other order and not the one I specified.

How does this reorder columns work then?

1 ACCEPTED SOLUTION

It is even worse than that. If you load the data, then in the data view they are in alphabetical order. But if you go back into Power Query and add new columns, they are added to the end, not in alphabetical order.

 

The only place the Reorder Columns feature is useful is when you are using Power Query in Excel and loading it to a worksheet as a table. That will retain the order.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

8 REPLIES 8
Icey
Community Support
Community Support

Hi @girishks90 ,

 

Please try to unload the table and re-sort the columns. Then, load the table again. Please check if this works.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

edhans
Super User III
Super User III

Be aware that if you do this @girishks90 it will wreck existing measures, visuals, relationships, and other settings like Sort By Columns.


I would do this only as a last resort if you really cannot stand the columns to be in a different order than you want. I would recommend just leaving it be. Intellisense fills out the names, it is in alphabetical order in the Field Listing in the report and model view, and you shouldn't be spending a lot of time in the Data view because creating Calculated Columns generally isn't a best practice, and for 1-2 per model, column order shoudn't be that impactful.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
lbendlin
Super User III
Super User III

Raise an idea or an issue for this request.  I see your point and will vote for it.

lbendlin
Super User III
Super User III

What are you eventually trying to accomplish?

In Data View, I want the columns to appear in a specific order that i mention in Table.ReorderColumns.

This order is important because some of the columns make sense only when they're together.

It also makes it easier for me to work with the data.

lbendlin
Super User III
Super User III

It is only (mildly) useful within the scope of the Power Query steps.  In general it is pretty useless. 

 

In Power BI columns are sorted alphabetically, for better or worse.  You can influence that by renaming columns.

It is even worse than that. If you load the data, then in the data view they are in alphabetical order. But if you go back into Power Query and add new columns, they are added to the end, not in alphabetical order.

 

The only place the Reorder Columns feature is useful is when you are using Power Query in Excel and loading it to a worksheet as a table. That will retain the order.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

It is not in alphabetical order in Data View. Just some random order.

I think you meant the list of columns we see in the fields section - it is alphabetical there.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors