Forum Discussion

SarahK's avatar
SarahK
New Member
4 years ago
Solved

Weeks are numbered from 1 to 145

Need help please i am working on a dataset and I don't have any dates columns except a week column that starts from 1 to 145. I am interested in converting this column to week numbers from 1 to 52 ...
  • HotChilli's avatar
    4 years ago

    You can add a column which uses Number.Mod (https://learn.microsoft.com/en-us/powerquery-m/number-mod ) to divide the week column by 52.  That will work great for all values except the multiples of 52 which will show as zero.

    So you can add another column which says 'if my newvalue is 0 then 52 else newvalue'

    --

    If you're confident with the code you could combine both steps in the first column