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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
caplogic
Helper I
Helper I

How to Get Dates in correct order

Hello community,

 

I'm very new to Power BI. 

 

I have imported a dataset into Power BI desktop. 

 

I have created a Line Chart visual. The actual values are correct, but I can't appear to get the order of the dates correct.

 

Can someone take a look at the visual and let me know where I might be going wrong.

 

The data is as follows:

caplogic_0-1710154810928.png

My line chart is as follows:

 

caplogic_1-1710154852872.png

 

The measure looks like the following:

 

caplogic_0-1710155145751.png

 

 

 

Let me know if you need the PBIX?

 

Thanks

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @caplogic ,

I created some data:

Thank @PowerBigginer  for sharing, and here’s a method I’d like to share with you all:

Power BI's default sorting is alphabetical, so you'll need to create a [Month] column and an [Index] table for sorting.

vyangliumsft_0-1710312112748.png

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
var _table1=
CALENDAR(
    DATE(2023,1,1),DATE(2023,12,31))
var _table2=
    ADDCOLUMNS(
        _table1,"Month",FORMAT([Date],"mmm"))
return
SUMMARIZE(
    _table2,[Month],"mindate",MINX(FILTER(_table2,[Month]=EARLIER([Month])),[Date]))

2. Joining a relationship between two tables

vyangliumsft_1-1710312112750.png

3. Select [Month] – Column tools – Sort by column – [mindate].

vyangliumsft_2-1710312156290.png

4. Result:

vyangliumsft_3-1710312156302.png

 

 

Best Regards,

Liu Yang

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  @caplogic ,

I created some data:

Thank @PowerBigginer  for sharing, and here’s a method I’d like to share with you all:

Power BI's default sorting is alphabetical, so you'll need to create a [Month] column and an [Index] table for sorting.

vyangliumsft_0-1710312112748.png

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
var _table1=
CALENDAR(
    DATE(2023,1,1),DATE(2023,12,31))
var _table2=
    ADDCOLUMNS(
        _table1,"Month",FORMAT([Date],"mmm"))
return
SUMMARIZE(
    _table2,[Month],"mindate",MINX(FILTER(_table2,[Month]=EARLIER([Month])),[Date]))

2. Joining a relationship between two tables

vyangliumsft_1-1710312112750.png

3. Select [Month] – Column tools – Sort by column – [mindate].

vyangliumsft_2-1710312156290.png

4. Result:

vyangliumsft_3-1710312156302.png

 

 

Best Regards,

Liu Yang

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

 

caplogic
Helper I
Helper I

Hi PowerBigger,

 

Thanks for getting in touch.

 

I tried your suggestion, but it doesn't appear to be working.

 

See screenshots below:

 

caplogic_0-1710159252619.png

 

caplogic_1-1710159315639.png

 

Dax Error please check your table I guess you don't have date column in your table try this way

MonthNumber = MONTH(DATEVALUE('DimDate'[MonthName] & " 1"))
in bolded text please replace with your table and column names
PowerBigginer
Helper II
Helper II

Create Month Num column in your date table 

MonthNum = MONTH(DimDate[CalendarDate])
then give sort order MonthNim to your Month Name column
PowerBigginer_0-1710157909654.png

then add MonthName to your Line chart

PowerBigginer_1-1710157960192.png

If it helps Please Mark as a solution 

For more power bi tips and tricks visit https://powertipstricks.blogspot.com/

Thanks & Regards

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