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
powerlight1
Helper I
Helper I

Create Week Start date column within a date table

Hi community,

 

I have a table with a date column and I am trying to create a new column that is Week_Starting (Monday).  I have already created the Week Num and Day of Week columns and I wanted to create a new Week Starting column where DayOfWk =1 within each of the Week_num rows. For example for all rows where Week_Num = 32, I want to select the row where DayOfWk=1 (ie 6/08/2024) and populate the new Week_Startig column with 6/08/2024.  I don't want to create another summarized table with only Week_Num and filter on where DayOfWk is only 1 and link this summarised table back into this table because my data model already has too many tables.  Is it possible to create this Week_Start column within this date table?

 

powerlight1_0-1763591041482.png

 

I wrote the below code but could not get it to work

 

 

WeekStart =
VAR _weeknum = 'Period Filter'[Week_Num]
VAR _table1 =
            SUMMARIZECOLUMNS(
                            'Period Filter'[Date],'Period Filter'[Week_Num]
                            ,FILTER('Period Filter','Period Filter'[DayOfWk]=1)
            )
RETURN
IF(
    _table1[Week_Num] = _weeknum
    ,_table1[Date]
    ,""
)

 

1 ACCEPTED SOLUTION

Hi,

 

If your DATE_LYSLS is continuous and there is no missing date, try this for a new column

WeekStart = [DATE_LYSLS] - (WEEKDAY([DATE_LYSLS], 2) - 1)

 

View solution in original post

3 REPLIES 3
powerlight1
Helper I
Helper I

hi community,

 

I tried rewriting the DAX statement by first creating a summarised table (_table1) and then use the summarised table to link back to the 'Period Filter' table using the Week_Num columns and return the Date column in the _table1.  However you can see I got an error message.

 

powerlight1_0-1763594572561.png

 

Hi,

 

If your DATE_LYSLS is continuous and there is no missing date, try this for a new column

WeekStart = [DATE_LYSLS] - (WEEKDAY([DATE_LYSLS], 2) - 1)

 

@MasonMA 

love the solution, so simple

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.