Forum Discussion
Continous week number
Hello
I want to create a continous column of week numbers. By this, I mean say that last week in 2012 was 53, then in jan 2013, the weeknumber should be 54 and so on
Regards
- Anonymous8 years ago
In Query Editor, try this. Add a custom column, and paste in this formula:
([Year] - List.Min(<Enter Previous Step Name Here>[Year])) * 53 + [Week Number]
This assumes 4 things.
1) You have a column called [Year] (modify the name in the formula needed)
2) You also have a column called [Week Number] (again, modify as needed)
3) There are always 53 weeks per year
4) [Week Number] is a column that always repeats from 1 to 53
The new column will not "reset" at 53, but will continue to increase.
- Anonymous8 years ago
Note, when you add the previous step name, it will need to follow this syntax:
if the previous step name is
Changed Type
then write this:
#"Changed Type"
Basically, wrap it in quotes and throw a # in front of it.
4 Replies
- AnonymousNot applicable
In Query Editor, try this. Add a custom column, and paste in this formula:
([Year] - List.Min(<Enter Previous Step Name Here>[Year])) * 53 + [Week Number]
This assumes 4 things.
1) You have a column called [Year] (modify the name in the formula needed)
2) You also have a column called [Week Number] (again, modify as needed)
3) There are always 53 weeks per year
4) [Week Number] is a column that always repeats from 1 to 53
The new column will not "reset" at 53, but will continue to increase.
- AnonymousNot applicable
Note, when you add the previous step name, it will need to follow this syntax:
if the previous step name is
Changed Type
then write this:
#"Changed Type"
Basically, wrap it in quotes and throw a # in front of it.
- Priyanshu208New Member
I am not able to understand what is "Enter Previous Step Name Here"
- AnonymousNot applicable
Any idea to to get a contious week number taking the fact into account that there are years with 52 weeks?