<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Function Calendar Wrong WeekNum in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2296072#M56598</link>
    <description>&lt;P&gt;You absolute legend!!&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jan 2022 17:34:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-21T17:34:35Z</dc:date>
    <item>
      <title>Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1377005#M25123</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;&lt;BR /&gt;I have a date table with the following DAX-Code:&amp;nbsp;&lt;SPAN&gt;Dates = CALENDAR(DATE(2018,01,01),DATE(2030,12,31))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;According to the &lt;A href="https://docs.microsoft.com/en-us/dax/weeknum-function-dax#remarks" target="_self"&gt;documentation&lt;/A&gt;, the WeekNum function works like this:&lt;BR /&gt;&lt;SPAN&gt;"By default, the WEEKNUM function uses a calendar convention in which the week containing January 1 is considered to be the first week of the year. However, the ISO 8601 calendar standard, widely used in Europe, defines the first week as the one with the majority of days (four or more) falling in the new year. This means that for years in which there are three days or less in the first week of January, the WEEKNUM function returns week numbers that are different from the ISO 8601 definition."&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;For the year 2021 happens exactly this case. There are 1.1. - 3.1. in the week 53 of the year 2020. But the the WEEKNUM-Functions shows this three days as the week no. 1 of the year 2021. The result, the WeekNum numbers don't match with the no. in europe.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;How can I fix mismatch?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks for help&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Mike_CH&lt;img /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 08:03:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1377005#M25123</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-17T08:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1377212#M25126</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Try these column and see if last column give you desired output&lt;/P&gt;
&lt;P&gt;Create a week start date&lt;/P&gt;
&lt;P&gt;Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 //Monday&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],1)+1 //Sunday &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Week Year = year([Week Start date])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First Week start of year = minx(filter('Date', [Week Year] =earlier([Week Year])),[Week Start date])&lt;/P&gt;
&lt;P&gt;Week of Year = Quotient( datediff([First Week start of year],[Date],Day),7)+1&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 09:14:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1377212#M25126</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-09-17T09:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1379327#M25196</link>
      <description>&lt;P&gt;Hi amitchandak&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution worked. Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice day.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Mike_CH&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 07:21:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1379327#M25196</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-09-18T07:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1575110#M31425</link>
      <description>&lt;P&gt;Hi Amitchandak,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your solution, but did not get it 100% right. My calender table starts with 2019 Oct (our fisical year goes from Oct-Sept).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;So when I used your method, first week in October becomes week 1. But it restarts as week 1 in January 2020, however not on the right day...&lt;/P&gt;&lt;P&gt;With your method Week 1 2020 starts on the 6th of Jan, but should be 30th of Dec 2019.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know how I could solve this? The incorrect weeks in 2019 are not important, since our reporting started&amp;nbsp; during 2020, however, I need the weeks to be correct from 2020 and forward.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Vanessa&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2020 14:40:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1575110#M31425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-30T14:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1601786#M32127</link>
      <description>&lt;P&gt;Hi Vanessa,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can substract 1 from week number if first week of year have less than 4 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DayOfWeek = WEEKDAY(DATE(YEAR([Date])1,1,),1)&amp;nbsp; // for calendars starting week on sunday&lt;BR /&gt;DayOfWeek =&amp;nbsp;WEEKDAY(DATE(YEAR([Date])1,1,),2)&amp;nbsp; // for calendars starting week on monday&lt;BR /&gt;&lt;BR /&gt;WeekNumber = WEEKNUM([Date]) - IF(DayOfWeek &amp;gt; 4, 1, 0)&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;/Antonio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 10:57:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1601786#M32127</guid>
      <dc:creator>AntonioFemxa</dc:creator>
      <dc:date>2021-01-15T10:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1607912#M32290</link>
      <description>&lt;P&gt;Thank you, Antionio! That did it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 09:12:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1607912#M32290</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-19T09:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1848397#M39459</link>
      <description>&lt;P&gt;You should use&amp;nbsp;WEEKNUM ( 'Date'[Date], 21 )&lt;/P&gt;&lt;P&gt;Returntype 21 = ISO 8601 Week or the European weeknumbering system, no need for custom formulas or functions.&lt;/P&gt;&lt;P&gt;You could also read more about the Weeknum function here:&amp;nbsp;&lt;A href="https://dax.guide/weeknum/" target="_blank"&gt;WEEKNUM – DAX Guide&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 09:45:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/1848397#M39459</guid>
      <dc:creator>PeJo</dc:creator>
      <dc:date>2021-05-18T09:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2225641#M52983</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a similar issue. My week needs to start on sunday and the column "calendarweeksunday" is sources from a snowflake database. I tried to create the yearweek which basically works but at the end of the year when it switches over to Jan 1st it will count as KW53 in year 2021 but it should be KW53 in 2020.&lt;/P&gt;&lt;P&gt;My current DAX is:&lt;BR /&gt;YEARWEEK = combinevalues("-w-", 'V_DIM_DATE (2)'[YEAR], format('V_DIM_DATE (2)'[CALENDARWEEKSUNDAY], "00"))&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 14:46:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2225641#M52983</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-07T14:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2296072#M56598</link>
      <description>&lt;P&gt;You absolute legend!!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 17:34:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2296072#M56598</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-21T17:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2300413#M56805</link>
      <description>&lt;P&gt;hi Michelle, did you get the solution for your problem? i too face the same issue. Wk52 2021 has to show last 4 days of Dec '21 and first 3 days of Jan'22. but it shows first days of Jan'21. Pls share solution if you found one.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 08:12:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2300413#M56805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-25T08:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Function Calendar Wrong WeekNum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2567474#M73203</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 20:42:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Function-Calendar-Wrong-WeekNum/m-p/2567474#M73203</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-08T20:42:35Z</dc:date>
    </item>
  </channel>
</rss>

