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
CloudMonkey
Post Prodigy
Post Prodigy

Wrong months order on graph

Hi,

 

Please can you tell me how to put these months in order? (November and December relate to the previous year so should be on the left hand side of the graph):

 

1838pm months wrong order.JPG

 

And these are the settings:

1842pm.JPG

 

1841pm.JPG

 

I was expecting to be able to sort by date, but it insists on sorting only by "Month Day":

1843pm.JPG

 

Thanks for any help,

 

CM

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @CloudMonkey ,

 

We can use the following steps to meet your requirement.

 

1. We need to create a month number column in your table, then create a calculated table contains sort value.

 

Month = Month('Table'[date])

 

W 5.jpg

 

 

Table 2 = ADDCOLUMNS(SUMMARIZE('Table','Table'[Month name],'Table'[Month]),"sort value",MOD([Month]+13,12)) 

 

 

W 1.jpg

 

2. Then create a relationship between month table and Table based on month name.

 

W 2.jpg

 

3. Create a line chart visual, put the Table 2[Month] to Axis, and sort by [sort value].

 

W4.jpg

 

W 3.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-zhenbw-msft
Community Support
Community Support

Hi @CloudMonkey ,

 

We can use the following steps to meet your requirement.

 

1. We need to create a month number column in your table, then create a calculated table contains sort value.

 

Month = Month('Table'[date])

 

W 5.jpg

 

 

Table 2 = ADDCOLUMNS(SUMMARIZE('Table','Table'[Month name],'Table'[Month]),"sort value",MOD([Month]+13,12)) 

 

 

W 1.jpg

 

2. Then create a relationship between month table and Table based on month name.

 

W 2.jpg

 

3. Create a line chart visual, put the Table 2[Month] to Axis, and sort by [sort value].

 

W4.jpg

 

W 3.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi,

You need to add a Month Number field to your date table, and then order the Month Name column by the month number.

Here is a very simple date table...

Date = 
VAR Dates = CALENDARAUTO(12)
Return
    ADDCOLUMNS(Dates,
    "Year", YEAR([Date]),
    "Quarter", FORMAT([Date], "\QQ"),
    "Month Num", Month([Date]),
    "Month", FORMAT([Date], "mmm"),
    "Week Num", WEEKNUM([Date],1),
    "Day of Month", DAY([Date]),
    "Day of Week", WEEKDAY([Date],1),
    "Day", FORMAT([Date],"ddd")
        )

 

 You can assign the order by either from the Model view, in the properties pane, under advanced, select the "Month Num" as the Sort by column. OR you can do it from the Report view, by selcting your Month column, and then in the toolbar under Column tools, selcet the Sort by column.

 

Hope that helps!

 

Kim

I thought you meant each month should increase by 1 e.g.

 

November 2019 = Month 1

December 2019 = Month 2

January 2020 = Month 3

February 2020 = Month 4

March 2020 = Month 5

 

But looking at the code I think it means:

November 2019 = Month 11

December 2019 = Month 12

January 2020 = Month 1

February 2020 = Month 2

March 2020 = Month 3

 

Please can you confirm? But if it's the latter I don't understand how that would solve my problem?

 

Thanks,

 

CM

LOL no worries. If I add year that works (if I switch to categorical data instead of continuous). But my users don't want to see the year on the axis - please do you know how to make this work without the year being visible?

 

1904pm.JPG

Anonymous
Not applicable

shoot... my previous reply doesn't solve your problem!

To solve this, you'll need to have the Year included in your table. 

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.