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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
lightyearsboi
Regular Visitor

ISO 8601 Year

Hi all,

 

I am using the below to add a column for the ISO week number in my calendar and it works great.

 

What I also need is a column to show ISO year... So for 30/12/19, it would show as 2020 as 30/12/19 is in ISO Week 1 of 2020.

 

So I am looking for a separate column in my table to show ISO "year" for all dates for previous and future years.

 

Can anyone help. Thanks.

 

ISO Date

 

if
Number.RoundDown((Date.DayOfYear([Date])-(Date.DayOfWeek([Date], Day.Monday)+1)+10)/7)=0
 
then
Number.RoundDown((Date.DayOfYear(#date(Date.Year([Date])-1,12,31))-(Date.DayOfWeek(#date(Date.Year([Date])-1,12,31), Day.Monday)+1)+10)/7)
 
else if
(Number.RoundDown((Date.DayOfYear([Date])-(Date.DayOfWeek([Date], Day.Monday)+1)+10)/7)=53
and (Date.DayOfWeek(#date(Date.Year([Date]),12,31), Day.Monday)+1<4))
 
then
1
 
else
Number.RoundDown((Date.DayOfYear([Date])-(Date.DayOfWeek([Date], Day.Monday)+1)+10)/7)

1 REPLY 1
harshnathani
Community Champion
Community Champion

HI @lightyearsboi 

 

 

yearISO = SWITCH(TRUE()
                ,_weeknum = 1 && _month = 12, YEAR([Date]) + 1
                ,_weeknum > 50 && _month = 1, YEAR([Date]) - 1
                , YEAR([Date])

 

 

Regards,

Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button) 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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