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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
StuartSmith
Power Participant
Power Participant

Identify next Wednesday & then Thursday on a Bi Weekly Rotation

I have a date table with a date column and need to identify the 1st Wedneday (starting from 01st Oct 2023 {01/10/2023}) and then the 2nd Thursday, then the 2nd wednesday, 2nd Thursday and so on.  Similar to the table below...

Date Day of Week Name Wednesday/Thursday 
01/10/2023 Sunday 0 
02/10/2023 Monday 0 
03/10/2023 Tuesday 0 
04/10/2023 Wednesday 1 
... ... ... 
17/10/2023 Tuesday 0 
18/10/2023 Wednesday 0 
19/10/2023 Thursday 1 
...     

 

04/10/2023 Wednesday
19/10/2023 Thursday
01/11/2023 Wedneday
16/11/2023 Thursday
29/11/2023 Wednesday
14/12/2023 Thursday
10/01/2024 Wednesday
25/01/2024 Thursday
07/02/2024 Wednesday
22/02/2024 Thursday
...

 

How can I create a culculated column that will do the above.

Thanks in advance.

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @StuartSmith ,

 

Based on your description, I created simple samples and you can check the results below:

vtianyichmsft_1-1701944629578.png

 

DimDate = 
ADDCOLUMNS (
    CALENDARAUTO (),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMMM" ),
    "MonthSort", MONTH ( [Date] ),
    "Day", DAY ( [Date] ),
    "DayName", FORMAT ( [Date], "DDDD" ),
    "WeekDay", WEEKDAY ( [Date],2 ),
    "WeekStart",
        [Date] - WEEKDAY ( [Date], 2 ) + 1
)

For Wed or Thr = 
var _t=ADDCOLUMNS('DimDate',"S",RANKX(FILTER(ALL('DimDate'),[WeekDay]=EARLIER([WeekDay])),[Date],,ASC,Dense))
return MAXX(_t,[S])

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

 

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @StuartSmith ,

 

Based on your description, I created simple samples and you can check the results below:

vtianyichmsft_1-1701944629578.png

 

DimDate = 
ADDCOLUMNS (
    CALENDARAUTO (),
    "Year", YEAR ( [Date] ),
    "Month", FORMAT ( [Date], "MMMM" ),
    "MonthSort", MONTH ( [Date] ),
    "Day", DAY ( [Date] ),
    "DayName", FORMAT ( [Date], "DDDD" ),
    "WeekDay", WEEKDAY ( [Date],2 ),
    "WeekStart",
        [Date] - WEEKDAY ( [Date], 2 ) + 1
)

For Wed or Thr = 
var _t=ADDCOLUMNS('DimDate',"S",RANKX(FILTER(ALL('DimDate'),[WeekDay]=EARLIER([WeekDay])),[Date],,ASC,Dense))
return MAXX(_t,[S])

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

 

 

Thanks, will review shortly and get back to you.

djurecicK2
Super User
Super User

Thanks, I aleady have the 2nd Tuesday code in my report, but couldnt figure out the wednesday/thursday bit.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.