cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sanoraya Frequent Visitor
Frequent Visitor

Sorting the Slicer

Hi, 

I am struggling with how to sort the slilcer the way I need: 

 

I have a table like this: 

Number Month

1           Jan

2           Feb. 

3           March

etc... 

 

The slicer only allows sorting alphabetically, but I want the months in the Slicere to be sorted by their Number. I know now the Slicer suprisingly doesn't allow to sort by another column in the table. So what are my options? 

I followed this recommerndation https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-sort-by-column/ and  sorted by the Number in the QueryEditor, but it has no effect on how the Months are displayed. Am I doing somehtign wrong, or is it Slicer's specific?

 

Thanks a lot!

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
GilesWalker Established Member
Established Member

Re: Sorting the Slicer

@sanoraya - To order your months by a number range I go to the data tab in Power BI desktop:

 

Data tab.PNG

 

In the ribbon you will see the Sort By Column button. Select the column you are interested in first (in my picture it would be Months), then click the Sort By Columns button.

 

Now you need to have a column which lists the months in the numeric order you want. For example, January will always show up as 1. In the sort by column button you will then need to click the appropriate column containing the month numbers.

 

This will then sort your slicer the way you want.

 

Thanks,

 

Giles

View solution in original post

B129 Member
Member

Re: Sorting the Slicer

Hi @sanoraya,

 

   try following my post here.

Let me know if it works.

 

#I'M Not An Expert#

View solution in original post

14 REPLIES 14
Highlighted
GilesWalker Established Member
Established Member

Re: Sorting the Slicer

@sanoraya - To order your months by a number range I go to the data tab in Power BI desktop:

 

Data tab.PNG

 

In the ribbon you will see the Sort By Column button. Select the column you are interested in first (in my picture it would be Months), then click the Sort By Columns button.

 

Now you need to have a column which lists the months in the numeric order you want. For example, January will always show up as 1. In the sort by column button you will then need to click the appropriate column containing the month numbers.

 

This will then sort your slicer the way you want.

 

Thanks,

 

Giles

View solution in original post

B129 Member
Member

Re: Sorting the Slicer

Hi @sanoraya,

 

   try following my post here.

Let me know if it works.

 

#I'M Not An Expert#

View solution in original post

sanoraya Frequent Visitor
Frequent Visitor

Re: Sorting the Slicer

Thank you very much!

Tcook Frequent Visitor
Frequent Visitor

Re: Sorting the Slicer

The solution is far easier than I thought. 

 

Steps

  1. In the "Fields" pane, click on the field that is being dispalyed.
  2. On the "Modeling" tab, click "Sort By Column".
  3. Chose the column that you want to sort the displayed field by.
  4. Viola
Tas1 Regular Visitor
Regular Visitor

Re: Sorting the Slicer

Hi, I did that but didn't work for me 😞 

 

I have a weekdays slicer and tried the same..I created a column of week days numbers and sorted by it ....it did sort the table but nothing changed on the report page the slicer is sorted alphabetically 

 Help Please !!!!!

jb1t Frequent Visitor
Frequent Visitor

Re: Sorting the Slicer

Is there a way to sort in descending order? I have 3 columns and ID, Name, and Count. I want to sort by the largest count first.

Werafa Frequent Visitor
Frequent Visitor

Re: Sorting the Slicer

Me too.

 

want calendar sorted by fin year.

Slicer is randomly sorted, and does not respond to sorting the source data table

Dag Frequent Visitor
Frequent Visitor

Re: Sorting the Slicer

I cannot see this working.

 

My report seems completely agnostic to sort order in the tables view. The control only gives me option of sorting in the order of the field itself 😞

 

EDIT: Hey Presto! I got it to work. It is crucial to understand that sort order is specified separately on each column, and not on the table as a whole. In the typical scenario, where one wants the slicer sorted according to values in another column, the relevant sort order must be specified on the column holding the display values of the slicer.

stijn977 Regular Visitor
Regular Visitor

Re: Sorting the Slicer

Nice one @Dag. That's the key 🙂 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 377 members 3,419 guests
Please welcome our newest community members: