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
ironboy0418
Helper II
Helper II

How to sort start of week column in my date table?

I am trying to sort start of week column using the week rank calculated column I've created. However, I am encountering this error:

 

ironboy0418_0-1681437489975.png

 

Start of week dax:

ironboy0418_4-1681437531816.png

Week Rank dax:

ironboy0418_5-1681437549479.png

 

 

1 ACCEPTED SOLUTION

hi @ironboy0418 

seems no need for the rank column, try to rewrite your column like:
Start of Week =
[Date]-WEEKDAY([Date])
 
Then you shall be able to sort by the column itself. Or?

View solution in original post

5 REPLIES 5
FreemanZ
Super User
Super User

hi @ironboy0418 

what do you mean by "sort start of week"?

Sorry. I am actually using it in my line chart, so that it will be sorted by start of week:

ironboy0418_0-1681439241583.png

Everytime I use sort by column, it gives me the above error:

 

ironboy0418_1-1681439273034.png

 

 

hi @ironboy0418 

seems no need for the rank column, try to rewrite your column like:
Start of Week =
[Date]-WEEKDAY([Date])
 
Then you shall be able to sort by the column itself. Or?

Thank you @FreemanZ the start of week column is actually a text data type that's why I am encountering the error. Appreciate the help!

Indeed, texts sort alphabetically. Number and Date are sorted numerically.

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.

Top Solution Authors