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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
fbjras12
New Member

Months in the wrong order

I made a spreadsheet with 3 tables. One of them relates Months, Results and goals. Only in the panel months are appearing in the wrong order. I would like it to appear in the order of the annual calendar. If anyone can help me I'll be grateful.

 

Panel Link: https://drive.google.com/drive/folders/0B1b9zTy_CQcRVmNjWjh0bURidlE

Link of source tables:https://drive.google.com/drive/folders/0B1b9zTy_CQcRVmNjWjh0bURidlE

8 REPLIES 8
Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @fbjras12,

 

The default sort order for text columns is alphabetically so I'm guessing your months are sorting this way?

 

To fix you'll need another column to control the sort order.  Preferablly using a numeric format.

 

I always add this column to my Date/Calendar tabales

 

MonthID = INT(FORMAT('Dates'[Date],"YYYYMM"))

And use this option on my Month column to tell it to sorth by the MonthID column.

 

SortByColumn.png

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Anonymous
Not applicable

@fbjras12

Try this in the Query Editor:

Table.AddColumn(<YOURLASTSTEP>, "YYYYMM", each "2017."&Number.ToText([Mes]))

I do not master this system. Please if you can pass me by what exactly I should write! Based on the name of my table, in the name of my date column, because I am not able to apply the formula.

 

THIS APPEAR: https://drive.google.com/file/d/0B1b9zTy_CQcRYkdXV29heUhRakU/view?usp=sharing 

Anonymous
Not applicable

I would suggest you to create the column in "GetData" aka PowerQuery and not in the DAX formula Bar.

My formula won't work in DAX as it is a Power Query formula.

 

If you have problems, I can create a gif for you.

I did a spreadsheet with some tables. One of them relates month, result and goal. I have ordered the months in abbreviated form (JAN, FEB, etc.). But the panels do not accept the fixed order of the annual calendar. What appears is: February, January, April, August ... Can anyone help me? I'll attach the panel image and the data source worksheet. My idiom on the spreadsheet is portuguese.

 

Dashboard= https://drive.google.com/drive/folders/0B1b9zTy_CQcRVmNjWjh0bURidlE

WorkSheet: https://drive.google.com/drive/folders/0B1b9zTy_CQcRVmNjWjh0bURidlE

Anonymous
Not applicable

or better:

 

=Table.AddColumn(<YOURLASTSTEP>, "YYYYMM", each Number.FromText("2017")*1000+[Mes])

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors