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
pantrax
Frequent Visitor

Column sort on date not working as expected

Hello! Trying to get sorting by date to work as i want, but run into a problem. I got a date column with "1.1.2018" etc using this as x axis allows me to drill down from year to daily. Problem is this sorts badly in a column chart giving me jan,nov,des if my data is from 01.11.2017 through 31.01.2018 I did some digging around and made a calculated column (YearMonth) and got that part working, it currently shows 201801,201712 etc as text. If i use this on the x axis i get close to what i'm looking for. I get it sorted in the order of earliest to last month (Yay!). No drill down available, and i get why. But the reason i made this calculated column was cause i read you could set the "date" column to use "YearMonth" with Sort by Column and then it should then sort correctly. Thats not whats happening with me though. Its not interested in changing the sorting from jan,nov,des - am i misunderstanding something? This is all in the same table.

bilde.pngbilde.png

 

 

5 REPLIES 5
v-yuezhe-msft
Employee
Employee

@pantrax,

I am unable to reproduce your issue, sorting works as expected in column chart, please view my example. Could you please share sample data of your table? And have you sorted your date fields by other columns?

1.JPG2.JPG3.JPG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
zayan
Regular Visitor

Hi @pantrax

 

Did you try chnging the data type in query editor? / or you could use another custom column based on "date" column.

pantrax
Frequent Visitor

Dont want to change it from date to another data type. I'm sure it'll just create other problems. I tried making a new custom column and sorting by it but didn't help any.

Greg_Deckler
Super User
Super User

That's a bit strange. I have a calendar table and the Date field is set to a data type of Date/Time and all of the sorting works as one would expect. Is your Date column a Date/Time data type in the model?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Yes it is. I've also tried YearMonth on both text and date.

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.