cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
eugen-nw Frequent Visitor
Frequent Visitor

Re: How Do I Sort By Source File, Not Alphabetical?

I have the data sorted in the query behind the visual - on multiple columns - so that's the order I want to see in the table as well.  Not the default behaviour which is to have the Table visual automatically sort the data for me automatically in ascending order on the first column.  Please add the "don't sort" option to the Table visual.

AndersTS Visitor
Visitor

Re: How Do I Sort By Source File, Not Alphabetical?

You can add a sort order column based on one or more column s that you want to sort on.  Add that column to the table in the report and sort by that column.  You can shrink the size of that column so it is not showing.  You cannot hide it but you can shrink it to nothing so it doesnt show anyway.

RBear Regular Visitor
Regular Visitor

Re: How Do I Avoid Alphabetical Sorting?

I find it hard to belive that PBI will have such a counterintuitive (and, under some circumstances, outright stupid) "feature" as a non-preventable sorting. So if I have a table where the first column is presented in some logical order (say, animals by ascending size - dog, horse, elephant), there is no way to preserve that order without resorting to all sorts of unnecessary gymnastics?

 

Is there really no way to prevent it?

Super User I
Super User I

Re: How Do I Avoid Alphabetical Sorting?

@RBear I'm not sure what the difficulty is. If you want a non-alphanumeric sort order, provide another column that has that order. Then under Modeling, select Sort By Another Column and choose the sort order column. So in your example, you would create two columns:

 

Animal     SortOrder

Dog          1

Elephant   3

Horse       2

 

 

I don't know if that's what you're refering to as unnecessary gymnastics but I can't think of any simpler alternative.


Did I answer your question? Please mark it as a solution.

Proud to be a Datanaut!
Highlighted
RBear Regular Visitor
Regular Visitor

Re: How Do I Avoid Alphabetical Sorting?



If you want a non-alphanumeric sort order, provide another column that has that order. Then under Modeling, select Sort By Another Column and choose the sort order column. So in your example, you would create two columns:

 

Animal     SortOrder

Dog          1

Elephant   3

Horse       2



Yes, this works, but it entails more than you let on - in a model that may be complicated enough already, you have to add a column, add it to the table in the report, make sure you click "Don't Summarize" and then go through the the fun process of hiding it. Of course, you should remember to document the whole process for the benefit of those who are going to maintain the model after you.

I don't know if that's what you're refering to as unnecessary gymnastics but I can't think of any simpler alternative.


A simpler alternative would be to just make sorting optional - as in adding "Don't Sort" just under "Don't Summarize"...

dawidvh Regular Visitor
Regular Visitor

Re: How Do I Sort By Source File, Not Alphabetical?

Hi @KHorseman,

 

That would greatly depend on the data source that you use. If you are using JSON for an examle, you might want to display the data in the exact order you received it as the data source might have already sorted it in a specific order that is not necessary chronologically or alpha-numerically sorted or sortable.

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors