Forum Discussion

Fidzi8's avatar
Fidzi8
Icon for Helper V rankHelper V
5 years ago
Solved

Wrong calender week

Hi, my report show me wrong number of week by the calendar.   Why I have second week but in a paper calender is first week of year?  Can I fix this? Thank you OndÅ™ej
  • amitchandak's avatar
    5 years ago

    Fidzi8 , You have to create a customer week

    like these columns in date table

     

    Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 // or use WEEKDAY('Date'[Date],1) for Sunday week

    min week start of year = minx(filter('Date',year([Week Start date])=earlier(year(Week Start date]))),[Week Start date])
    week No = quotient(datediff([min week start of year],[date],day),7)+1
    Week Start Year = minx(filter('Date',[Year] =earlier([Year])),[Week Start date])

     

     

    There are a couple of issues logged on this in last week, as this does not match with other Microsoft calendar in other apps

    one is - https://community.powerbi.com/t5/Issues/DAX-WEEKNUM-gives-incorrect-values-since-jan-1st-2021/idi-p/1583824