Forum Discussion

jensroy's avatar
jensroy
New Member
10 years ago

Weeknumber bug or intended?

Hi all,

 

I have a column formated as "Date" in the way of "yyyy-mm-dd", named "date2". My data starts on 2016.01.01 until today.

 

I currently report on Weekly activites, and I wish to use the following formula to extract week number from [date2]

 

Weeknumber = WEEKNUM('Activites'[date2],2)

 

However.... January 1st is considered Week 1. Actually January 1st belongs to week number 53 in year 2015.

 

Is there a way to make this work out of the box?

1 Reply

  • MattAllington's avatar
    MattAllington
    Community Champion

    Well it is not a bug. There are literally hundreds of different ways a business can use a calendar, so functions can't cater for them all. The solution is to create a calendar table.  Read my blog article here http://exceleratorbi.com.au/power-pivot-calendar-tables/

     

    in in your case, you just add a week number ID column that matches your needs and use that column instead of the formula you mention.