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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Elisa112
Helper II
Helper II

Sort dates in month order for bar chart visual

Hi Experts 

I am trying to sort my visual into the correct month order (ascending by month).  I have data from Sept 2023 onwards. The 2023 months are in the correct order however not for 2024. See below

Elisa112_0-1715247644138.png

I'm probably missing something very simple, any advice greatly received.

thanks in advance

 

1 ACCEPTED SOLUTION
miTutorials
Super User
Super User

6 REPLIES 6
miTutorials
Super User
Super User

Watch this short tutorial to sort months on the Column chart.

 

How to Sort Months the right way in PowerBI | Bar Chart | MI Tutorial - YouTube

Thank you @miTutorials 

PhilipTreacy
Super User
Super User

Hi @Elisa112 

 

Download example PBIX file

 

I suspect your 'date/month' column is actually text and in your chart it is sorting alphabetically in descending order S -> A

 

You need to use a proper date column like this

 

datecols.png

 

The data will then sort correctly

 

datecols2.png

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi @PhilipTreacy 

thanks for your assistance, my tables looks like this:

Elisa112_0-1715256748273.png

Elisa112_2-1715257088617.pngElisa112_3-1715257130812.png

 

 

I also have a customer table with dates such as (referral date, start date). So I created a measure to calculate the total customers but the visual shows the months in the wrongorder. I have tried creating a sorting column on my customer table but I get the following error when I try this solution

 

Elisa112_1-1715257038709.png

 

Any further help much appreciated.

Elisa112

 

 

 

fahadqadir3
Resolver II
Resolver II

@Elisa112 You can sort the months by using the following calculated column:

Sorting Condition = - ( YEAR('Table'[Date])*100+MONTH('Table'[Date]) )

Screenshot_5.png

Sort the month by sorting condition:

Sorted by.png

Power BI file attached:

Sorting.pbix

 

Regards,

Fahad Qadir

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

Gabry
Responsive Resident
Responsive Resident

Hello,

what columnd did you put on the x axis? Like month? You have to sort that column by date.

If it's a column from the calendar table.

You go in the dataview, then select the month column, than select order by date, if you can't order by date you need a month number column and then you sort by month number. Hope I made my point

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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