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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Winniethewinner
Helper IV
Helper IV

"synchronized" week number across different years

Hi everyone, 

I'm not sure if there is a solution for my problem, I have below the calendar month/week and comparing sales YoY: 

2024-09-12 10_28_26-ATL DDS RM.png

However, the issue is that for some month/weeks in LY, it doesn't exist in CY. For example, April and the 13th week of the year only exist in LY, which is an issue because it'll be showing a very negative YoY.

I'm not sure if there is any solution to create a "synchonized" week number across different years. For example Jan 1-7 will be week1, no matter which year it is.

 

Thank you. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi Selva-Salimi ,thanks for the quick reply, I'll add more.

Hi @Winniethewinner ,

Regarding your question, since February 2024 has 29 days, there will be problems on April 1st.

Try this.

Column = 
VAR _year = [Date].[Year]
VAR _date = [Date]
VAR _number = MONTH([Date]) *100 + DAY([Date])
VAR _table  = ADDCOLUMNS('Table',"number" , MONTH([Date]) *100 + DAY([Date]))
RETURN 
    
    INT((RANKX(FILTER(_table,[Date].[Year] = _year && [number] <> 229),[Date],,ASC,Skip) - 1) / 7 ) + 1

vzhouwenmsft_0-1726646687427.png

vzhouwenmsft_1-1726646721079.png

 

Best Regards,
Wenbin Zhou

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi Selva-Salimi ,thanks for the quick reply, I'll add more.

Hi @Winniethewinner ,

Regarding your question, since February 2024 has 29 days, there will be problems on April 1st.

Try this.

Column = 
VAR _year = [Date].[Year]
VAR _date = [Date]
VAR _number = MONTH([Date]) *100 + DAY([Date])
VAR _table  = ADDCOLUMNS('Table',"number" , MONTH([Date]) *100 + DAY([Date]))
RETURN 
    
    INT((RANKX(FILTER(_table,[Date].[Year] = _year && [number] <> 229),[Date],,ASC,Skip) - 1) / 7 ) + 1

vzhouwenmsft_0-1726646687427.png

vzhouwenmsft_1-1726646721079.png

 

Best Regards,
Wenbin Zhou

Selva-Salimi
Super User
Super User

hi @Winniethewinner 

 

I think that you need a modified week numbering. you can write a calculated column as follows:

 

week_number := var _days = calculate (count ('date' [dateID]) , filter ('Date' , 'Date' [dateID] <= earlier ('date' [dateid]) && 'Date' [year] = earlier ('date' [year] ) )) / 7

return roundup (_days , 0 )

 

then you should use this column in your calculations and visualizations.

 

If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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