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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
svishwanathan
Helper III
Helper III

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

2 ACCEPTED SOLUTIONS
Anonymous
Not 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.

View solution in original post

Anonymous
Not 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.

View solution in original post

4 REPLIES 4
Anonymous
Not 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.

Anonymous
Not applicable

Any idea to to get a contious week number taking the fact into account that there are years with 52 weeks?

I am not able to understand what is "Enter Previous Step Name Here"

Anonymous
Not 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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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