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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Get saturday of the week from weeknumber

Team,

I have a fisweek column and the data looks something like this 2020406,2020407, etc year & week now I need to create a date column which gives saturday date of the week based on the week number.

 

 

Thanks!

Raki

1 ACCEPTED SOLUTION
dk_dk
Super User
Super User

Hi @Anonymous ,

Assuming your input data is 8-character long text in yyyymmdd format, you can use this DAX calculation in a calculated column, to calculate the saturday date of the given week. It does not even need the week number 😉

saturdayofweek = 

VAR _year = LEFT(dates[date],4)
VAR _month =LEFT(RIGHT(dates[date],4),2)
VAR _day = RIGHT(dates[date],2)
VAR fulldate = DATE(_year,_month,_day)

VAR dayofweek = WEEKDAY(fulldate)
VAR diff_to_sat= 6-dayofweek

VAR sat_of_week = fulldate + diff_to_sat

RETURN
sat_of_week

 

If your input data is in a different format you might need to tweak the _year, _month and _day cariables to extract the year, month and day, to construct the date in date format correctly. If your data is in date format already, you can also just use a direct column reference to your date column instead of the fulldate variable, and it should work (then you can remove the other vars before that).

Let me know if you have any questions.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
dk_dk
Super User
Super User

Hi @Anonymous ,

Assuming your input data is 8-character long text in yyyymmdd format, you can use this DAX calculation in a calculated column, to calculate the saturday date of the given week. It does not even need the week number 😉

saturdayofweek = 

VAR _year = LEFT(dates[date],4)
VAR _month =LEFT(RIGHT(dates[date],4),2)
VAR _day = RIGHT(dates[date],2)
VAR fulldate = DATE(_year,_month,_day)

VAR dayofweek = WEEKDAY(fulldate)
VAR diff_to_sat= 6-dayofweek

VAR sat_of_week = fulldate + diff_to_sat

RETURN
sat_of_week

 

If your input data is in a different format you might need to tweak the _year, _month and _day cariables to extract the year, month and day, to construct the date in date format correctly. If your data is in date format already, you can also just use a direct column reference to your date column instead of the fulldate variable, and it should work (then you can remove the other vars before that).

Let me know if you have any questions.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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