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
Alisea_MI
Advocate III
Advocate III

Dynamic Date Axis Sorting of Text Data Type

Hi, Power Bi experts!

 

I need to set up a Dynamix Date Axis that shows dates on different granularity levels depending on what I choose in the slicer pane. I have created a table with the code below and it works fine to change the granularity on the axis.

 

HOWEVER the sorting is wrong (please see the picture below).

 

I am not able to sort the "VisualDate" column by the "Date" column. It gives me an error.

The "Visuals Date" column itself has a Text format.

 

Could anyone please help me with any ideas of how I can make the sorting work?

Thank you so much in advance!

 

Screenshot 2021-06-24 121933.jpg

1 ACCEPTED SOLUTION
Alisea_MI
Advocate III
Advocate III

The workaround we have found was that to put Year first, e.g. YYYY-MM-DD, YYYY-W, YYYY-MM. In this case its's being sorted correctly. 

View solution in original post

3 REPLIES 3
Alisea_MI
Advocate III
Advocate III

The workaround we have found was that to put Year first, e.g. YYYY-MM-DD, YYYY-W, YYYY-MM. In this case its's being sorted correctly. 

Alisea_MI
Advocate III
Advocate III

@amitchandak  Yes, I don't have 1-1 mapping since it's a dynamic axis with Day, Week, Month and Year granularity. So my week is formatted as "W52-20".  Do you by any chance know any possible workarounds?

amitchandak
Super User
Super User

@Alisea_MI , you get this value when you do not have one to one mapping between the sort column and sorting column, Please check dates that; what is not matching, there are two sort order(date)  for the same vosual date

 

How to Create Sort Column and Solve Related Errors: https://youtu.be/KK1zu4MBb-c

 

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.