In SQL Server 2008 the isoweek can be found with this:
SELECT datepart(iso_week, getdate())
Before SQL Server 2008 there were no built-in f
I needed something similar for PowerQuery & PowerBI and based on t-clausen.dk's response I was able to make this equation. It works the same as his but uses PowerQuery syntax. Also the base date for the DATEDIFF of 0 was 1/1/1900 in SQL but in PowerQuery it is 12/30/1899 so I use 2 instead of the 0.
ISO Week = Number.RoundDown((Date.DayOfYear(Date.From(Duration.Days(([Date]-Date.From(2))/7)*7+5))+6)/7)
I also needed the ISO Year so I made an adjustment to the ISO Week calculation and came up with:
ISO Year = Date.Year(Date.From(Duration.Days(([Date]-Date.From(2))/7)*7+3))
Change the [Date] to reference the date column in the data.