Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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:
When I use this column as a slicer, months are sorted in an alphabetic order:
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!
Solved! Go to Solution.
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
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?
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.
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
Hello, Joe! Your solution seem to work except for one error I get when sorting by new column:
User | Count |
---|---|
91 | |
73 | |
68 | |
63 | |
55 |
User | Count |
---|---|
98 | |
89 | |
73 | |
62 | |
61 |