Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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

 

 
  • Anonymous's avatar
    Anonymous
    6 years ago

    It works, thank you very much!

7 Replies

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

    • Anonymous's avatar
      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.

      • amitchandak's avatar
        amitchandak
        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's avatar
    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:

     

    Aiolos Zhao

  • Greg_Deckler's avatar
    Greg_Deckler
    Community 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.