Forum Discussion
Sort using the Sort by Column Button not Working
I am trying to sort a simple table of data using the Sort by Column button on the Modeling ribbon (and the one on the Modeling tab). I can never get it to work. I have followed the steps from the directions on https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-sort-by-column/ but the order never changes.
The column I am trying to use is a simple numeric index column, created using the built-in function. It doesn't work on any field I have tried, whether included in the table of displayed data or not.
Any suggestions welcome.
Hi, Using your sample:
Select Description from Field Panel after that go To Sort By Column and Choose Index.
And Voila!!!.
Like this:
Victor
Lima - Peru
16 Replies
- MattAllingtonCommunity Champion
The target column ( column you want to sort) must have the identical grainularity of the sort column, and there must be a 1 to 1 match between the columns. So if you have a month name column, there are 12 unique values. The sort column must also have 12 values. If 1 = Jan then 1 must always = Jan. The 1:1 match must never chabge
- GazzerResolver II
Thanks for the reply - none of what you describe is mentioned in the documentation: https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-sort-by-column/#sort-using-the-sort-by-column-button
I will try what you have described, but at the moment it feels like it will be impractical to implement (I accept I could be wrong)
- v-sihou-msftMicrosoft Employee
MattAllington is correct. It must be 1 to 1 relationship, which means it can only be one value for each entry in to column you want to sort. Otherwise, it will throw error message like below:
Regards,
- GazzerResolver II
Thanks for the info. However, I do not get any error message, the sort order simply does not change.
I am unclear as to why there would need to be a 1:1 relationship (or any relationship) when I am using a field within the table I am attempting to sort.
- shill1000Helper IV
Are you simply trying to sort a table by one column or is there a reason you are trying to use the 'Sort by Column' function?
The first can be done simply by using the table header to sort the table.
The second is an option to sort a visual by a column on a reference table. As indicated, the reference table must have a 1:1 relationship with the data in the table you want to sort. This is used when you have a specific sort order that needs to be applied, inctead of a generic alphnumeric sequence.
What exactly are you trying to achieve?