cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate IV
Advocate IV

Sort by Column does not change sorting order

Hi,

 

My goal:

 

List ONLY the names of the TOP 5 sales people in my organization by using the "Sort by column" feature. 

 

EDIT: The columns "FirstName" & "LineTotal" come from separate tables if that matters.

 

My steps so far:

  1. I added a simple table with the "FirstName" column, listing all the salespersons.
  2. I added a visual level filter with the "Top N" filter type set to 5, values from "LineTotal" sales column. Works fine, but the sorting is wrong.
  3. I then chose the table tile, chose the datatable where "LineTotal" is and clicked the "Sort by Column" button and chose "LineTotal" as the sort order. Nothing happens, the sorting does not change. 

 

If I add the "LineTotal" column to the table, I can see it correctly chooses the TOP 5 earners but the sorting is wrong:

 

PowerBI - Sort hidden column (2018-03-28).png

 

The only way to sort the columns correctly is to manually click the "LineTotal" sort arrow, but I don't want to display the column in the first place, only the names.

 

What am I doing wrong here?

4 REPLIES 4
Community Champion
Community Champion

@carlosDash

Couple things you can do

1) If you do want to use the Sort by Column option you actually need to change the default sort of the FirstName column

so FirstName should Sort By LineTotal

OR

2) Simply click the ellipsis (...) in the top right corner of the visual and select Sort by LineTotal (ZtoA)

Good Luck! Smiley Happy

 

 

Thanks for your reply @Sean!

 

1. How do I do this? I have currently chosen the tile, then I've chosen the "LineTotal" from the right side pane and then clicked on the "Sort by Column" button. It shows "LineTotal" shown as the sorting method, but it still sorts incorrectly.

 

2. I can't use this method since I don't actually want to list the sales values. I just added them to the screenshot to prove that the sorting does not work.

 

Another screenshot:

 

PowerBI - Sort hidden column 2 (2018-03-28).png

 

 

 

Community Champion
Community Champion

How are the two tables related?

 

1) Create a FirstName Rank Column in the Table containing FirstName

This Column should Rank DESC based on the Line Total from the other Table

2) Sort FirstName by this new Column

3) then Filter TOPN - show Bottom 5 - by value - sum of FirstName Rank

 

Hope this helps! Smiley Happy

They're related through my data model. The relation works properly in my report, there should not be an issue.

 

I think what's happening here is that I'm essentially using the sorting correctly, but PBI doesn't understand how to sort the sums correctly. I haven't tried creating a proper TOP N style column for this I did create a simple manual type of rank where I gave values to the employees from "1 to 5". Sorting that worked as expected. 

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors