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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

How to keep the data sort the same with Datasource?

Hi All, I meet a problem, the data of column A in excel has the sort but the sort is not by ASC or DESC, is set by user as business requierement, e.g., the sort of the column A is as below:

Column A
One
Two
Three

 

But, after we get the excel and import to Power BI desktop, the data sort will be changed, and can only sort as ASC or as DESC:

20200225.png

So my question is can we make the sort be same with the original data? Thanks

 

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

It works, thank you very much!

View solution in original post

7 REPLIES 7
Greg_Deckler
Super User
Super User

You need a second column that defines the correct sort. Then you can set your column to have a Sort By of your second column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Anonymous ,

 

Normally a workaround for this is to add a new index column next to the Column A, then you can sort by this new index column.

 

Please try to use below method:

How to keep the data sort the same with Datasource.PNG

 

Aiolos Zhao

amitchandak
Super User
Super User

You can choose sort column of your choice. Or refer to my Direct Query blog in my signature

Sort_by_column.png

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

@amitchandak  in this way, then need to display the sorted column, too. So for the case that we need to add an index column to do the sort, then seems not perfect to display the index column out in a table or Matrix.

Anonymous
Not applicable

Hi @Anonymous ,

 

Actually you don't need to show the index column in your table, after you created the index column,

 

1. select the column that you want to sort in the front-end

2.click the button in below screenshot

3.choose the index column that you created

 

then you will found that you don't need to show the index column in your table, and the table will sort by the index column

 

 Please try.

 

Aiolos Zhao

 

How to keep the data sort the same with Datasource 2.PNG

Sort column takes care internally. You do not have to anything other than sort on your main column.

 

This is what we do

Month Year = format(Date,"MMM-YYYY")

Month year Sort = format(Date,"YYYYMM") // We make this as sort column of the month year

 

In visual we go and sort on Month Year. But power bi sort it on Month year Sort 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

It works, thank you very much!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.