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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bryanc78
Helper IV
Helper IV

Chart months - out of order

Data/column format - 1/2/2019

Axis format - Month hierarchy

chart sort - Month, ascending order

 

Trying to get January to show on the right side and it's not working, even though the other months are.  Is there a simple setting I'm missing?

 

 

month.PNG

1 ACCEPTED SOLUTION

Looks like I got it to work

 

I duplicated call date and transformed it to Name of Month.  I put that into the axis and was then able to sort that by Call Date - Month Year

 

Not sure why just a straight duplicate would not work until I transformed it

View solution in original post

11 REPLIES 11
Greg_Deckler
Super User
Super User

Strange, usually this is controlled by a numeric "Sort By" column. Do you have of those?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

No I do not.

 

I'm thinking I need to duplicate my date column then transform that to monthnumber?  So 1/2/2019 will now be 1?

Then I can sort that way

 

No other way?

 

Edit- that works but now January is at the beginning as it comes before October; 1 vs 10.  Need to figure out how to add the year in there

Yes you can create a duplicate column of your date column and transform that to month. Then you can sort it my month number. I do it all the time. Sort should have Ascending and Descending. You can dupliate the date column and transform it to year.

@sureshsonti

 

Can you expand on that a bit more?  I tried this solution Here but now I'm getting a can't sort by another column error message

@bryanc78 - So, assuming you have a date column, then you should duplicate that column in the Query Editor, let's call it [Date 2], then you should be able to create something like this:

 

 

Column = YEAR([Date 2]) & FORMAT(MONTH([Date 2]),"0#")

And use that as your sort by, you should end up with text strings like:  201801, 201802...201901, etc.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

 

It's not working.  Here is what I have:

 

Original column - Call Date

I duplicated that column and called it Call Date 2

I then created a calculated column using your formula and got the results I was looking for; 201901, 201811 etc.  This column is called Call Date - MonthYear

In my visualization, I put Call Date 2 into the Axis, and removed all levels but Month.  The issue is when I try to sort Call Date 2 by Call Date - MonthYear I get the "sort by another column" error

 

What's perplexing is it's working for October - December, sorted by Month ascending but January is throwing it off

Columns.PNGerror.PNG

And you duplicated Call Date in Power Query and not DAX?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler

 

Yes, duplicated the column in Power Query and in normal viewing, outside of Power Query, I created a new column and formatted it based on your instructions

I'm not sure what is going wrong here perhaps I am missing some component. See Table 11 of the attached PBIX. I started with an Enter Date query with just Date column. In Power Query, I created a duplicate column, Date - Copy. I created a sort Column based on Date - Copy. I can sort Date based upon Sort.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Looks like I got it to work

 

I duplicated call date and transformed it to Name of Month.  I put that into the axis and was then able to sort that by Call Date - Month Year

 

Not sure why just a straight duplicate would not work until I transformed it

Cost by MonthName & Day.JPG

 

Createa  calculated column for MonthName

MonthName = FORMAT(Sheet1[Date],"MMM")

 

Use MonthName and Day on the Axis

 

On the visualization you will  see an UP ARROW, DOWN ARROW and 2 DOWN ARROWS and another symbol which is also 2 DOWN ARROWS. Select the 4 one and you should get the screenshot that I attached

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.