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
Dave1982
Frequent Visitor

Sort by Column Not Working for Month Number in Slicer

I have a data set that I have imported into Power BI that has an Outreach date column, Month, and Month Number column.  Date column is formatted as a date, Month is formated as text, and Month Number is formatted as Whole Number. I want to add a slicer that shows the Month is numerical order versus alphabtical order. I have used the sort by column on the outreach date and selected the Month Number column as this has worked for me in the past. For some reason it does not work in this scenerio. 

Dave1982_0-1624457406833.png

I want to be able to have the above show as April, May, June, etc instead if April, June, and May.

I have a similiar data set that works with no issues be sorting the column by outreach date and month number.

Dave1982_1-1624457630600.png

I am not getting an error when I am doing the sort, but it is not working when I either add a slicer or any visualizations.

Dave1982_1-1624458542193.png

 

 

Any help is much appreciated.

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Dave1982 that measure you month number value for the same month is not consistent.

 

For example, in some rows for the month of April, the month number is 3 or 4 or another value, basically, each month should have the same month number value. Check your data. Seems like there is inconsistency in your data. 

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@Dave1982 that measure you month number value for the same month is not consistent.

 

For example, in some rows for the month of April, the month number is 3 or 4 or another value, basically, each month should have the same month number value. Check your data. Seems like there is inconsistency in your data. 

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Dave1982 based on your original post, the following doesn't make sense. Why you are sorting the date column by Month Number, as suggested by others, you need to sort Month column by Month Number not Outreach Date column by Month Number.

 

 I have used the sort by column on the outreach date and selected the Month Number column

 

Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k The reason is that when I sort by Month and Month Number I get an error that is returned to me.

Dave1982_0-1624460197963.png

 
 

Dave1982_4-1624460337942.png

 

 

 

Yes, your "Month Number" column is incorrect, with different values for a single month. How are you getting that column ? Probably the simplest way is to generate a calculated column like..

Month Number = month(TableName[Outreach Date])

 

Stuart

Burningsuit
Resident Rockstar
Resident Rockstar

Hi Dave,

In the grid view, you need to select the Month column and then click "Sort by column" (In the "Column Tools" tab). From the drop down there select the Month Number column. Actually sorting the column as you have done does not make any difference, you need to use the "Sort by Column" to make those Months sort correctly.

 

Hope this helps

 

Stuart

 

amitchandak
Super User
Super User

@Dave1982 , based on what I got. I think you need to make sure that month no is sort column for Month(Text) .

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

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.

Top Solution Authors
Top Kudoed Authors