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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.