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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

sort date in slicer

hi all

any idea how i can sort the date , so that the lastest month is on the top? Thanks so much.

 

2 ACCEPTED SOLUTIONS
az38
Community Champion
Community Champion

@Anonymous you didnt do sort by column.

click left mouse on your YYYYMM column in the Fields Pane (right part of powerbi window) 

then find and press button Sort by Column and choose YYYYMMdigits

424650.png

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

az38
Community Champion
Community Champion

Hi @Anonymous 

your column [Calendar Month Number] stores month number without leading 0.

to fix it you should either change format this field or rewrite column like this

yyyymmdigit = if('Date'[Calendar Month Number]<10;CONCATENATE('Date'[Calendar Year];concatenate("0";'Date'[Calendar Month Number]));CONCATENATE('Date'[Calendar Year];'Date'[Calendar Month Number]))

do not hesitate to give a kudo to useful posts and mark solutions as solution

  


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

9 REPLIES 9
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

What is the type of your [YYYYMM] column, Date or Text?

If it's Date type, you can refer to @Tahreem24 's answer.

If it's Text type, you'd better to convert this column to a date type.

So how does the column come from? is it your original data?

If it comes from a combination of the other two columns, you can refer to @az38 's answer.

YYYYMM = CONCATENATE([YYYY]&" ", [MM])

Then, convert this column to a date type.

h6.PNG

 

If the column is original data, firstly, you need to split the column, then regroup.

 

Best regards,
Lionel Chen

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Anonymous
Not applicable

@v-lionel-msft

@az38 

so sorry, i got the same problem again, it was ok yesterday, where i have gone wrong in this file?

https://gofile.io/?c=VTBF0q

 

Capture.JPG

 

az38
Community Champion
Community Champion

Hi @Anonymous 

your column [Calendar Month Number] stores month number without leading 0.

to fix it you should either change format this field or rewrite column like this

yyyymmdigit = if('Date'[Calendar Month Number]<10;CONCATENATE('Date'[Calendar Year];concatenate("0";'Date'[Calendar Month Number]));CONCATENATE('Date'[Calendar Year];'Date'[Calendar Month Number]))

do not hesitate to give a kudo to useful posts and mark solutions as solution

  


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

I finally got it....thank you so much 😃

Anonymous
Not applicable

Thanks all...I finally got it.

Mine was a text field, after the sorting, now it works!

 

Tahreem24
Super User
Super User

@Anonymous ,

 

By clicking on 3 dots on slicer and select Descending. Refer screen shot for your reference.

 

Capture.JPG

Don't forget to hit THUMBS UP and mark it as a solution if it helps you!

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
az38
Community Champion
Community Champion

Hi @Anonymous 

create new column

YYYYMMdigits = CONCATENATE('Date'[Fiscal Year];'Date'[Fiscal Month Sort Order])

then pick your field YYYYMM in the Field Pane. Go to Sort By Column button and select YYYYMMdigits

there is your sample file https://ufile.io/s3ouf2e0

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 

would you helping me see when i have gone wrong?

https://gofile.io/?c=kwMC9H

Thanks so much

x.PNG

az38
Community Champion
Community Champion

@Anonymous you didnt do sort by column.

click left mouse on your YYYYMM column in the Fields Pane (right part of powerbi window) 

then find and press button Sort by Column and choose YYYYMMdigits

424650.png

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

October NL Carousel

Fabric Community Update - October 2024

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