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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Bobbys
Helper III
Helper III

Help with ISO dates!!

Hello everyone,

I'm trying to set up a report for my company and am facing difficulties calculating correct YTD and YTD-1 measures due to the fact that the date format in the data source is odd.

Bobbys_0-1652290849109.png

 

As seen in the picture above, the data source shows data for week 52 of 2022, which should be impossible. This is most likely due to week 52 2021 going into 2022, thus being identified as 2022. I've attemped to create a custom date column (due to the fact that my data doesn't include any specific dates, only week number & year), by combining year and week number into a column, then using this formula to create dates:

 

Dato =
VAR __Year = VALUE(right([weekyear],4))
VAR __Week = VALUE(left([Weekyear],2))
VAR __Calendar = ADDCOLUMNS(CALENDAR(DATE(__Year,1,1),DATE(__Year,12,31)),"Week",WEEKNUM([Date]))
RETURN
MINX(FILTER(__Calendar,[Week]=__Week),[Date])
 
This however, for obvious reasons, gives me dates and values for december 2022, as seen in the picture under:
Bobbys_1-1652291140790.png

 

 I found a date format which appears to show correct year and week in hopes that I can make some sort of relation between the "week year" columns in my main query and my date table, but haven't been able to figure out how to do it. This is the date table I created:

Bobbys_2-1652291237467.png

 

 Please, any help is well appreciated!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Bobbys,

I'd like to suggest you create a calendar table with the custom 'year week' field to link to the current table fields. Then you can use the related date field values for YTD calculations.

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @Bobbys,

I'd like to suggest you create a calendar table with the custom 'year week' field to link to the current table fields. Then you can use the related date field values for YTD calculations.

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@Bobbys , Try if this can help

New column = Weeknum([Date],21)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello @amitchandak. Okay, I've made the column. How should I proceed?
Thank you

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.