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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jodallen123
Helper I
Helper I

Problem with week of year, week of year 1 in both 2024 and 2025

Hi,

 

I have created a simple line graph with year/month name/week of year on the x-axis, the graph is set to show the last 2 months. The problem is that week 1 appears in both 2024 and 2025 and ends up at the start of december and at the start of january instead of at the end of december and the start of january.

 

I created a calculated column like this: "UniqueYearWeek = YEAR([Date]) * 100 + WEEKNUM([Date], 2) +DAY([Date]) / 1000" and then tried to sort week of year by that column, but since each week of year appears multiple times, that does not work. 

 

I feel like this is a problem that more people probably have faced. How have you solved it? 

 

Thanks in advance!

 

Jodallen123_0-1736495689848.png

 

3 REPLIES 3
BeaBF
Super User
Super User

@Jodallen123 Hi! Try with:

AdjustedWeekYear =
VAR StartOfWeek = [Date] - WEEKDAY([Date], 2) + 1 // Start of the week (ISO standard)
VAR WeekYear = YEAR(StartOfWeek) // Year of the start of the week
RETURN WeekYear * 100 + WEEKNUM([Date], 2)

 

Replace the column used for sorting and x-axis ordering with this new.

 

BBF

 

Thanks!

 

I added this column but I am not sure of how to use it. Do you mean that I should sort my "week of year"-column by that new column? Because that does not work. Or do you mean that I should use it instead of week of year in my graph like below? Or is there another option?

 

Ideally I want the same layout as in the first picture I posted, but with week 1 in december after week 52, but maybe that's not possbile? 

 

Jodallen123_0-1736499938648.png

 

Anonymous
Not applicable

Hi, @Jodallen123 

 

Forgive me for not fully understanding your question. Is this the result you expected?

vzhangtinmsft_0-1736753899469.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.