Forum Discussion
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:
So my question is can we make the sort be same with the original data? Thanks
- Anonymous6 years ago
It works, thank you very much!
7 Replies
- amitchandakSuper User
You can choose sort column of your choice. Or refer to my Direct Query blog in my signature
- AnonymousNot 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.
- amitchandakSuper 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
- AnonymousNot 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:
Aiolos Zhao
- Greg_DecklerCommunity Champion
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.