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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Sort Order issue!!

So here is a few pictures related to the issue i am having.

The first picture is the visual issue:

Maleehah_0-1628243790077.png

The months go in Alphabetical order instead of chronological. 

Dax measure for rolling column is:

Rolling =
VAR FutureMonth = IF(MONTH(TODAY()) > 6 , MONTH(TODAY())-6 , MONTH(TODAY()) + 6)
VAR FutureYear = IF(MONTH(TODAY()) > 6 , YEAR(TODAY())+1 , YEAR(TODAY()) )

Return

IF('Date Table'[Date] < DATE(YEAR(TODAY()), MONTH(TODAY()), 1) , BLANK () ,
IF('Date Table'[Date]>= DATE(FutureYear, FutureMonth, 1) , "Rest of the Dates" , [month] )

)
 
below are screenshots of the sort by for each colum in my dates table:
Maleehah_1-1628243911399.pngMaleehah_2-1628243949315.pngMaleehah_3-1628243975673.pngMaleehah_4-1628244003156.pngMaleehah_5-1628244023292.pngMaleehah_6-1628244043806.pngMaleehah_7-1628244060447.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

This error occurs because the value of [Month Year sort] in a [Rolling] column exceeds 1 value, for example, there are 23 "1"s in an "Out of Date" in your visual object, resulting in Power bi don't know which one to use.

 

You need to find something to order by that has the same granularity as [Rolling], for example: the format of January is 1, and there will be errors in sorting. We can use the combination of Month and Day, so you can sort normally.

 

This is the content of the same error, I hope it helps you:
https://community.powerbi.com/t5/Desktop/Date-table-can-t-sort-other-columns-by-date-Getting-error/td-p/1092086

https://community.powerbi.com/t5/Desktop/Sort-by-Quarter-not-Working-with-an-Index/td-p/1236234

 

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

This error occurs because the value of [Month Year sort] in a [Rolling] column exceeds 1 value, for example, there are 23 "1"s in an "Out of Date" in your visual object, resulting in Power bi don't know which one to use.

 

You need to find something to order by that has the same granularity as [Rolling], for example: the format of January is 1, and there will be errors in sorting. We can use the combination of Month and Day, so you can sort normally.

 

This is the content of the same error, I hope it helps you:
https://community.powerbi.com/t5/Desktop/Date-table-can-t-sort-other-columns-by-date-Getting-error/td-p/1092086

https://community.powerbi.com/t5/Desktop/Sort-by-Quarter-not-Working-with-an-Index/td-p/1236234

 

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

Anonymous
Not applicable

Error message when sorting rolling column 
Maleehah_2-1628258069534.png

 

also I have got an order now but im having to show the months twice 

Maleehah_3-1628258193315.png

 

 

amitchandak
Super User
Super User

@Anonymous , not sure why it is based on today not on date example

 

Month Year = FORMAT([Date],"mmm")
Month Year sort = if(month([Date]) >6, month([Date])  -6, month([Date]) +6)

 

and mark as the sort column .

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I've added both columns but its still not sorting the matrix 
also this is a selection of the data which is relevant to the table

 

Maleehah_1-1628257075767.png

plus the date table 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.