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 September 15. Request your voucher.

Reply
Uzi2019
Super User
Super User

Sort week column by multiple values in date

Hi Expert,
I have Date, Start Week, End Week, and Week columns. I want to sort my week column based on date or start week column but because of multiple values in date column I cant sort it. 

Uzi2019_0-1687323924788.png


Can anyone have any idea how to sort column by multiple values in date column???

Thank you in advance. your help would be appreciated.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
3 REPLIES 3
Anonymous
Not applicable

 okay, follow below steps

 

Create a new calculated column in your data model that calculates the minimum or maximum date for each week. For example, if you want to use the minimum date, you can use the following formula:

 

DAX
 

 

  • MinDate = CALCULATE(MIN('YourTable'[Date]), ALLEXCEPT('YourTable', 'YourTable'[Week]))

    This formula calculates the minimum date within each week, considering only the rows that have the same Week value as the current row.

  • Once you have the new calculated column (e.g., MinDate), go to your table visualization and select the Week column.

  • In the "Modeling" tab of the Power BI ribbon, click on the "Sort ascending" or "Sort descending" button to sort the Week column based on the MinDate column you just created.

     

  •  

  •  

@Uzi2019

Anonymous
Not applicable

HI @Uzi2019 ,

Try below steps

 

To sort the Week column in Power BI based on multiple values in the Date column, you can follow these steps:

  1. Select the Week column in your table visualization.
  2. In the "Modeling" tab of the Power BI ribbon, click on the "Sort by Column" button.
  3. In the dialog box that appears, select the Date column from the drop-down list.
  4. Click OK to apply the sort.

By specifying the Date column as the sort column for the Week column, Power BI will use the values in the Date column to determine the sorting order of the Week column. This way, your Week column will be sorted based on the corresponding dates.

That's not an issue. Issue is multiple datas in date column. That's throwing an error while sorting week column by date.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors