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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Custom Bi-Weekly Week of the Year Column

I'm looking to calculate a column in my date table that will incrementally associate a number with the date every two weeks instead of the traditional week but start on a Wed rather than Mon.

 

I tried to display below but essentially, every two weeks starting from Day A to end date of Day B which we have running mid week so doing "start of week" formula didn't seem to work well. 

 

The table would be something like the below:

I'm looking to populate the WeekofYear column with an incremental number every two weeks. 

 

DateWeekofYear
1/1/20201
1/2/20201

1/3/2020

1
1/4/20201
......(continues to next date)

1

1/14/2020 (next week that is 2 weeks out)

2

1/15/2020

2

1/16/2020

2

...(continues to the next )

2

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@V-pazhen-msft 

 

I was able to find the below blog to get the day to start on Wed but your solution for week.no result did not work for this solution.  I reverted to the same values after changing the formula to match the new columns.

 
week.no result = RANKX('Date','Date'[WeekofYear2 (wed-Tues)],,ASC,Dense)
 

https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Anonymous 

You might need to do some dax on the week number. Check the pbix for detail.

week.no.JPG


Paul Zheng _ Community Support Team

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

Anonymous
Not applicable

@V-pazhen-msft 

 

I was able to find the below blog to get the day to start on Wed but your solution for week.no result did not work for this solution.  I reverted to the same values after changing the formula to match the new columns.

 
week.no result = RANKX('Date','Date'[WeekofYear2 (wed-Tues)],,ASC,Dense)
 

https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...

Anonymous
Not applicable

@V-pazhen-msft this does help but one small adjustment that I don't know how to fix.  

 

Instead of the week starting on Sunday, how would this be adjusted to start on Wed and end on Tues? Everything else looks great besides that small details.  Thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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