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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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.


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
AiolosZhao
Memorable Member
Memorable Member

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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

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.

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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 

Anonymous
Not applicable

It works, thank you very much!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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