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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Daemetius
Helper II
Helper II

How to sort months axis in graph like in query table?

Greetings,

 

So I have an issue where the months are sorted apparently by name from A-Z in the X-axis of the graph in the picture. Then there's the query table of how they are aligned accordingly. Is there any way to make it so it shows JUST like in the table? I am able to do it in excel where April is the starting point and May is the next and so on.

 

Thanks in advanced.

 

Months sorted by name in graph and the actual tableMonths sorted by name in graph and the actual table

2 ACCEPTED SOLUTIONS

Hi @Daemetius

 

According to your description above, you should be able to follow steps below to sort the Months column with April starting out and then May, June, July, August, September, October, November, December, January, February, March in your scenario.

 

1. Add an Index Column under Query Editor > Add Column tab > Index Column. And click Close&Apply under Home tab.

 

ic1.PNG

 

2. Select Months column, click Sort by Column and select Index.

 

sort1.PNG

 

Then the Months column will be sort properly. Smiley Happy

 

Regards

View solution in original post


@v-ljerr-msft wrote:

Hi @Daemetius

 

According to your description above, you should be able to follow steps below to sort the Months column with April starting out and then May, June, July, August, September, October, November, December, January, February, March in your scenario.

 

1. Add an Index Column under Query Editor > Add Column tab > Index Column. And click Close&Apply under Home tab.

 

ic1.PNG

 

2. Select Months column, click Sort by Column and select Index.

 

sort1.PNG

 

Then the Months column will be sort properly. Smiley Happy

 

Regards


What I did was add a date column with mm/dd/yyyy format, for example March 1, 2017 and that also solved it.

View solution in original post

11 REPLIES 11
Greg_Deckler
Super User
Super User

You will want to use Sort By functionality.



Follow on LinkedIn
@ 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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...


@smoupre wrote:

You will want to use Sort By functionality.


 

I tried it (if this is the one you are referring to). I sorted by Month and it automatically sorts its by Name like in the picture of the X-axis. It's very frustrating. I honestly don't know why it's doing it, when clearly the table has it in the right order I desire.

 

 

sortby.png

You would need to sort by Month number, not Months. If you do not have a separate column for month number, you can create one using DAX's MONTH() function.


@deldersveld wrote:

You would need to sort by Month number, not Months. If you do not have a separate column for month number, you can create one using DAX's MONTH() function.


I'm quite beginner with DAX functionalities. How would that work exactly? You are saying I require a column with the actual numerical months so that it may be actually sorted correctly, but I can do it with DAX?

Would that sort it from January to December? I would like for it to sort it in the order that it's in the query table. I was able to make the graph in the exact order in Excel with April starting out and then May, June, July, August, September, October, November, December, January, February, March.

Hi @Daemetius

 

According to your description above, you should be able to follow steps below to sort the Months column with April starting out and then May, June, July, August, September, October, November, December, January, February, March in your scenario.

 

1. Add an Index Column under Query Editor > Add Column tab > Index Column. And click Close&Apply under Home tab.

 

ic1.PNG

 

2. Select Months column, click Sort by Column and select Index.

 

sort1.PNG

 

Then the Months column will be sort properly. Smiley Happy

 

Regards


@v-ljerr-msft wrote:

Hi @Daemetius

 

According to your description above, you should be able to follow steps below to sort the Months column with April starting out and then May, June, July, August, September, October, November, December, January, February, March in your scenario.

 

1. Add an Index Column under Query Editor > Add Column tab > Index Column. And click Close&Apply under Home tab.

 

ic1.PNG

 

2. Select Months column, click Sort by Column and select Index.

 

sort1.PNG

 

Then the Months column will be sort properly. Smiley Happy

 

Regards


What I did was add a date column with mm/dd/yyyy format, for example March 1, 2017 and that also solved it.

Hi @Greg_Deckler,

 

Great to hear the problem got resolved! Could you accept helpful replies as solution to help others who may also have the similar issue easily find the answer and close this thread? Smiley Happy

 

Regards

Additionally, is your organic data labeled as pictured (Named months) or is it in a date format 

 

  • 1/1/17
  • 2/1/17
  • 3/1/17 ...


@Miskondukt wrote:

Additionally, is your organic data labeled as pictured (Named months) or is it in a date format 

 

  • 1/1/17
  • 2/1/17
  • 3/1/17 ...

The data I get it from is from Excel table and no, it's a column with the name of the months. I think it may be the culprit since the cells are formatted as text for that column.

Have you tried using that section cut off on the right of your image for formatting your values to dates? You currently have it listed as text, perhaps date will help in your issue.

PBINumberFormatting.png

 

 


@Miskondukt wrote:

Have you tried using that section cut off on the right of your image for formatting your values to dates? You currently have it listed as text, perhaps date will help in your issue.

PBINumberFormatting.png

 

 


 

 

 

 

This is what I have. All grayed out except text.

 

Updated ScreenshotUpdated Screenshot

 

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.