Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
carlosDash
Advocate V
Advocate V

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
Sean
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

 

 

 

Sean
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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.