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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
genashpuryk
Helper I
Helper I

Month sorting within slicer

Hi everyone! I encountered a sorting problem, which is slightly different from the ones I found solved.

I have a custom table with Month list in a correct order:

genashpuryk_0-1712236617932.png

When I use this column as a slicer, months are sorted in an alphabetic order: 

genashpuryk_1-1712236700778.png

Is it possible to list them from Jan to Dec? I have seen a couple of solutions, using ranking or custom sorting, but I can't find a way to add this type of column to my month table. Any help would be valuable. Thanks in advance!

1 ACCEPTED SOLUTION
Joe_Barry
Super User
Super User

Hi @genashpuryk 

 

You need a sort column, so Jan = 1, Feb = 2 etc...

 

In Power Query add a custom column

 

if [Month] = "January" then 1 else 

if [Month] = "February" then 2 else 

if [Month] = "March" then 3 else 

if [Month] = "April" then 4 else 

if [Month] = "May" then 5 else 

if [Month] = "June" then 6 else 

if [Month] = "July" then  7 else 

if [Month] = "August" then 8 else 

if [Month] = "September" then 9 else 

if [Month] = "October" then 10 else 

if [Month] = "November" then 11 else 

if [Month] = "December" then 12 else  0

 

 

Load your table and go to table view, highlight the Month column and in the ribbion, click on sort by and choose the new column you created.

 

Thanks

Joe

 

If you found my answer helpful and it solved your issue, please accept as solution

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


View solution in original post

4 REPLIES 4
Joe_Barry
Super User
Super User

I honestly haven't seen that error in such a case before. Are you using the most recent version of Power BI? I heard that there are some issues with this version. Have you tried to close the popup and check the visual?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


No, my version is a bit older. I decided to put ranks in a slicer box, using 1-2-3 instead of Jan-Feb-Mar, so your solution works perfectly for me. Thank you again! Have a nice day. 

Joe_Barry
Super User
Super User

Hi @genashpuryk 

 

You need a sort column, so Jan = 1, Feb = 2 etc...

 

In Power Query add a custom column

 

if [Month] = "January" then 1 else 

if [Month] = "February" then 2 else 

if [Month] = "March" then 3 else 

if [Month] = "April" then 4 else 

if [Month] = "May" then 5 else 

if [Month] = "June" then 6 else 

if [Month] = "July" then  7 else 

if [Month] = "August" then 8 else 

if [Month] = "September" then 9 else 

if [Month] = "October" then 10 else 

if [Month] = "November" then 11 else 

if [Month] = "December" then 12 else  0

 

 

Load your table and go to table view, highlight the Month column and in the ribbion, click on sort by and choose the new column you created.

 

Thanks

Joe

 

If you found my answer helpful and it solved your issue, please accept as solution

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


Hello, Joe! Your solution seem to work except for one error I get when sorting by new column: 

genashpuryk_0-1712237879988.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.