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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Chronological Week Number Order in Matrix Over Multiple Years

Hello,

 

I'm trying to get my "Week Num and Week Start Date" column in my Matrix Visual to order correctly from left to right(i.e...W52 12/22, W53 12/29, W2 01/05, W3 01/12, etc.). However, the chronological order is broken once I refresh the data to bring in January data.

 

This is what my Matrix looks like before the January data is brought in. Everything looks good.

Matrix-ChronologicalOrderofWeekNumbers-Current.PNG

 

After I refresh the dataset and bring in January data, then the ordering of the Week Nums is incorrect. I want the Week Nums to continue on the right-hand side after "W53 12/29".

Matrix-ChronologicalOrderofWeekNumbers-After.PNG

 

I added in the Calendar Year column from my Date Dim to the Matrix which helps a little but then "W53 12/29" is split between the Years 2019 and 2020 as Week 53 overlaps over both Years.

Matrix-ChronologicalOrderofWeekNumbers-YearAdded.PNG

 

Is there a way to handle this particular scenario? I would rather leave out the Year from my Matrix Visual but I'm ok with incorporating the Year column in my Matrix to get the correct Week Number order. I would then need "W53 12/29" for the Year 2020 to fall before "W2 01/05" but after "W53 12/29" for the Year 2019 instead of where it's located right now after "W4 01/19".

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

If you can use week year.

create a week's year. For that get week strat date as a new column and have week year as another

Week Start date = DATEADD('Date'[Date],-1*WEEKDAY('Date'[Date])+1,DAY)
Week Year =year('Date'[Week Start date])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
mpsAutomation
Frequent Visitor

How did you managed to add the Calendar Year to avobe the weeks on the matrix, I know is unrelated but it will solve my issue

amitchandak
Super User
Super User

If you can use week year.

create a week's year. For that get week strat date as a new column and have week year as another

Week Start date = DATEADD('Date'[Date],-1*WEEKDAY('Date'[Date])+1,DAY)
Week Year =year('Date'[Week Start date])

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, I have the same situation however I did not understand what I have to do.
I have a date table in which there is the year, the week number and the start of the week date(date of each monday). How can I proceed now? I tried to sort the week number column for the star of week date but it does not work...

Capture.JPG

Anonymous
Not applicable

@amitchandak 

I ended up using your strategy to determine the Year based on the Week Start Date. Then I added this Year column to my Matrix and got the desired results. If needed, I can always put a textbox over the Year portion of the Matrix to hide that data element from being seen by the users. Thanks!

Anonymous
Not applicable

@amitchandak 

I haven't tried your recommendation yet but it sounds like it will get me the desired results but is there a way to leave out the Year from the Matrix Visual but still get the desired Week Number ordering?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.