Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
numersoz
Helper III
Helper III

Python Export Column Sorting Changes

Hi,

I am using Python scrpit to pull data. On Jupyter Lab the pd dataframe column order is just fine. But when I export data on PowerBI using the same exact script, column name orders to alphabetical by itself.

 

Does any one have an idea why this would be the case?

 

 

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi @numersoz 

In power bi, the data is sort by alphabetical by default.

And you could use "sort by column" to custom it. see more details as below:

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column#sort-using-the-sort-...

https://radacad.com/sort-by-column-in-power-bi

 

Regards,

Lin

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

Hi it is alphabetical by default on modelling view but not on Power Query. It is by the original column order there. All other data sources I export are by original order except for the one that I am trying to get from Python.

 

When I run the Python code outside of PowerBI it is working but just inside Power Query it is not by the original order.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.