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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
agusti_oliveres
Frequent Visitor

How to sort a date-type slicer in descending order

Hi,

I have a normal slicer with a date-type field, with month granularity. By default, the months are sorted by ascending order (from the older months at the top to the current ones at the bottom), but I would like to sort it in descending order. I have not been able to figure out how to do it. Can anyone help me with that?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Is it simply the months you want in reverse order?  For example you are showing a slicer with December, November etc?

 

If thats the case, you will need a date table and a sort column.

 

If you have a date table already, GREAT!  If not you will need to make one, which is fairly easy.

 

Once you have that, you should have a column with the Month Name and the Month Number.  This Month Name will be the column for your slicer.

 

Next you need a calculated column called "Month Sort" and its formula will be to take the month number and make 12 = 1, 11 = 2 etc.  We can do that with math by doing:

Month Sort = 13 - [Month Number]

Lastly, select your Month Name column and in the ribbon under "Modelling" select 'Sort By Column' and choose your Month Sort.

View solution in original post

7 REPLIES 7
nazirstaples
Regular Visitor

  1. Click on the Slicer, then click on three dots below (i.e. More Options)
  2. Press "Sort Descending", and Sort by "Month."

nazirstaples_0-1744302019599.jpeg

 

can you do by year and month descending ? 

 

Anonymous
Not applicable

Is it simply the months you want in reverse order?  For example you are showing a slicer with December, November etc?

 

If thats the case, you will need a date table and a sort column.

 

If you have a date table already, GREAT!  If not you will need to make one, which is fairly easy.

 

Once you have that, you should have a column with the Month Name and the Month Number.  This Month Name will be the column for your slicer.

 

Next you need a calculated column called "Month Sort" and its formula will be to take the month number and make 12 = 1, 11 = 2 etc.  We can do that with math by doing:

Month Sort = 13 - [Month Number]

Lastly, select your Month Name column and in the ribbon under "Modelling" select 'Sort By Column' and choose your Month Sort.

Hi i got your logic see now i got here a question lets suppose there are two years 2022/12/31 and 2023/2/25 now will this logic wont help.can you provide me an alternate solution

I tried to do this with date using a calculated column like this.

SortOrderDateDesc = - DATEDIFF('DateDim'[date_natural].[Date], date(9999, 12, 31), DAY)

 

But when I try to sort the slicer on the date_natural column, I get error:

"Sort by another column. This column can't be sorted that is already sorted, directly or indirectly, by this column".

 

Any suggestions?

I tried to do this with date using a calculated column like this.

SortOrderDateDesc = - DATEDIFF('DateDim'[date_natural].[Date], date(9999, 12, 31), DAY) 

 

But when I try to sort the slicer on the date_natural column, I get error:

"Sort by another column. This column can't be sorted that is already sorted, directly or indirectly, by this column".

 

Any suggestions?

I tried to do this with date using a calculated column like this.

SortOrderDateDesc = - DATEDIFF('DateDim'[date_natural].[Date], date(9999, 12, 31), DAY) 

 

But when I try to sort the slicer on the date_natural column, I get error:

"Sort by another column. This column can't be sorted that is already sorted, directly or indirectly, by this column".

 

Any suggestions?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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