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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
GiulianoPowerBI
Regular Visitor

Date Hierarchy in a line chart. Month name ordering

Hello,

I did setup a line chart with an x axis layered for year, month name and day.

One i drilldown on an year, I'm having issue to sort month name by proper order and not like this (by alphabetical order):

 

 

unnamed.png

 

How can I solve?

Thank you

3 ACCEPTED SOLUTIONS
PijushRoy
Super User
Super User

Hi @GiulianoPowerBI 

Create a Monthly lookup table with sort order
Then Month column should be sort by Sortorder column

PijushRoy_0-1703969623870.png


Create relationship with your Fact table by Month column 
Use the newly created month column in Visual and use Visual sort by month

If solved your requirement, please mark this answer as SOLUTION. Appreciate your KUDOS 


Thanks
Pijush




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @GiulianoPowerBI ,

 

I can provide you with a schematic schedule Please check:

vtianyichmsft_0-1704072846555.png

DimDate = 
ADDCOLUMNS (
    CALENDARAUTO (),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMMM" ),
    "MonthSort", MONTH ( [Date] ),
    "Day", DAY ( [Date] ),
    "DayName", FORMAT ( [Date], "DDDD" ),
    "WeekDay", WEEKDAY ( [Date],2 ),
    "WeekStart",
        [Date] - WEEKDAY ( [Date], 2 ) + 1
)

You can sort by any column.

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @GiulianoPowerBI ,

 

I can provide you with a schematic schedule Please check:

vtianyichmsft_0-1704072846555.png

DimDate = 
ADDCOLUMNS (
    CALENDARAUTO (),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMMM" ),
    "MonthSort", MONTH ( [Date] ),
    "Day", DAY ( [Date] ),
    "DayName", FORMAT ( [Date], "DDDD" ),
    "WeekDay", WEEKDAY ( [Date],2 ),
    "WeekStart",
        [Date] - WEEKDAY ( [Date], 2 ) + 1
)

You can sort by any column.

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

 

 

PijushRoy
Super User
Super User

Hi @jjrand 

In DateTable, need to change the SortBy order for Month. 
Otherwise it will sortby Alphabetic order

@GiulianoPowerBI If you using, DataTable, please use DAX Month('DateTable'[Date]) to create another column for MonthNumber.
MonthName should be SortBy MonthNumber column (assuming your year start from Jan to Dec)


If solved your requirement, please mark this answer as SOLUTION. Appreciate your KUDOS 


Thanks
Pijush




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





PijushRoy
Super User
Super User

Hi @GiulianoPowerBI 

Create a Monthly lookup table with sort order
Then Month column should be sort by Sortorder column

PijushRoy_0-1703969623870.png


Create relationship with your Fact table by Month column 
Use the newly created month column in Visual and use Visual sort by month

If solved your requirement, please mark this answer as SOLUTION. Appreciate your KUDOS 


Thanks
Pijush




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





This would work, however I would suggest creating a proper date table

 

https://www.sqlbi.com/articles/creating-a-simpler-and-chart-friendly-date-table-in-power-bi/

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors