<?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: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859207#M6918</link>
    <description>&lt;P&gt;HiAnonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're a star mate. Your code is working just perfectly.&lt;/P&gt;&lt;P&gt;One last thing... can I change the format of the Reporting Period dates to read as... DD/MM/YYYY?&lt;/P&gt;&lt;P&gt;Thanks, B&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2019 05:24:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-11-28T05:24:12Z</dc:date>
    <item>
      <title>Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/835970#M6192</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;This project started on 03 December 2017 on Sunday. Week starts from Monday through to Sunday. FYI - Project will go until 2022 and FYE is 30th June.&lt;/P&gt;&lt;P&gt;I want the week number to change dynamically every week to reflect the current week since 03 December 2017 as shown in the screenshot. Also, just below the report title, I want to show reporting period dates for the last week as shown in the screenshot.&lt;/P&gt;&lt;P&gt;I have created a DAX table by copying code from &lt;A href="https://www.sqlbi.com/articles/using-generate-and-row-instead-of-addcolumns-in-dax/" target="_blank" rel="noopener"&gt;https://www.sqlbi.com/articles/using-generate-and-row-instead-of-addcolumns-in-dax/&lt;/A&gt; but am not sure how to get the Week Number 99? The screenshot shows the data I've got thus far in the Date table.&lt;/P&gt;&lt;P&gt;After achieving this, I need to get the reporting period incorporated dynamically as well.&lt;/P&gt;&lt;P&gt;All the 12 tables have the same date and the data looks similar to the screenshot.&lt;/P&gt;&lt;P&gt;I thought I would use DAX instead of M Language Script because I could re-use this DAX Date table for other reports waiting to be developed on this project.&lt;/P&gt;&lt;P&gt;Can anyone please let me know how to achieve this? Any guidance is greatly appreciated!&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Bhoga&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 07:53:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/835970#M6192</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-04T07:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/838102#M6282</link>
      <description>&lt;P&gt;Anyone..!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;P&gt;Bhoga&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 02:49:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/838102#M6282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T02:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/838201#M6285</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALENDAR 5 = 
VAR BASECALENDAR =
    CALENDAR ( DATE ( 2017, 12, 03 ), DATE ( 2022, 06, 30 ) )
RETURN
    GENERATE (
        BASECALENDAR,
        VAR BASEDATE = [DATE]
        VAR YEARDATE = YEAR ( BASEDATE )
        VAR MONTHNUMBER = MONTH ( BASEDATE )
        VAR MONTHNAME = FORMAT ( BASEDATE, "MMMM" )
        VAR YEARMONTHNAME = FORMAT ( BASEDATE, "MMM YY" )
        VAR YEARMONTHNUMBER = YEARDATE * 12 + MONTHNUMBER -1
        VAR WeekNumber = FORMAT(WEEKNUM(BASEDATE,2),"00")
        RETURN ROW (
            "DAY", BASEDATE,
            "YEAR", YEARDATE,
            "MONTH NUMBER", MONTHNUMBER,
            "MONTH", MONTHNAME,
            "YEAR MONTH NUMBER", YEARMONTHNUMBER,
            "YEAR MONTH", YEARMONTHNAME,
            "Year Week Number",CONCATENATE(YEARDATE,WeekNumber)
        )
    )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Calculated Column = RANKX(FILTER(ALL('CALENDAR 5'[Year Week Number]),RIGHT('CALENDAR 5'[Year Week Number],2)&amp;lt;&amp;gt;"53"),'CALENDAR 5'[Year Week Number],,ASC)-1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Hi&amp;nbsp;&lt;BR /&gt;Can you please add Year week number in your calendar table (1 st code) and then create a column to get the week number&lt;BR /&gt;In case you want to exclude week number 53 for each year use&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;YearWeekNumber =&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX(FILTER(ALL('CALENDAR 5'[Week Number]),RIGHT('CALENDAR 5'[Week Number],2)&amp;lt;&amp;gt;"53"),'CALENDAR 5'[Week Number],,ASC)-1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 06 Nov 2019 06:00:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/838201#M6285</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T06:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/838246#M6287</link>
      <description>&lt;LI-CODE lang="markup"&gt;Expected = RANKX(FILTER(ALL('CALENDAR 5'[Year Week Number]),RIGHT('CALENDAR 5'[Year Week Number],2)&amp;lt;&amp;gt;"53"),'CALENDAR 5'[Year Week Number],,ASC)-1&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;CALENDAR 5 = 
VAR BASECALENDAR =
    CALENDAR ( DATE ( 2017, 12, 03 ), DATE ( 2022, 06, 30 ) )
RETURN
    GENERATE (
        BASECALENDAR,
        VAR BASEDATE = [DATE]
        VAR YEARDATE = YEAR ( BASEDATE )
        VAR MONTHNUMBER = MONTH ( BASEDATE )
        VAR MONTHNAME = FORMAT ( BASEDATE, "MMMM" )
        VAR YEARMONTHNAME = FORMAT ( BASEDATE, "MMM YY" )
        VAR YEARMONTHNUMBER = YEARDATE * 12 + MONTHNUMBER -1
        VAR WeekNumber = FORMAT(WEEKNUM(BASEDATE,2),"00")
        RETURN ROW (
            "DAY", BASEDATE,
            "YEAR", YEARDATE,
            "MONTH NUMBER", MONTHNUMBER,
            "MONTH", MONTHNAME,
            "YEAR MONTH NUMBER", YEARMONTHNUMBER,
            "YEAR MONTH", YEARMONTHNAME,
            "Year Week Number",CONCATENATE(YEARDATE,WeekNumber)
        )
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Nov 2019 06:06:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/838246#M6287</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-06T06:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/839502#M6333</link>
      <description>&lt;P&gt;HiAnonymous&lt;/LI-USER&gt;&lt;/P&gt;&lt;P&gt;Your code works.. amazing! thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you're right. the week actually starts from 27 November 2017.&lt;/P&gt;&lt;P&gt;Is there any change I need to do into your coding for this to work correctly?&lt;/P&gt;&lt;P&gt;Note: To make it very clear to you.. Current Week from 04 November 2019 to 10 November 2019 is Week 100 as per my Business confirmation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a million.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards, B&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 06:58:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/839502#M6333</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-07T06:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/839731#M6338</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;If&amp;nbsp;&lt;SPAN&gt;04 November 2019 to 10 November 2019 is Week number 100 as per your business requirement than above code will do the work for you&lt;/SPAN&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 09:56:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/839731#M6338</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-07T09:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/840558#M6356</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&lt;/P&gt;&lt;P&gt;Thanks a million for the timely help, greatly appreciated.&lt;/P&gt;&lt;P&gt;Kind regards, B&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 04:36:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/840558#M6356</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-08T04:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859136#M6915</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I actually needed to display Last Week Number which is 102 and Last Week Period which is 18/11/2019 to 24/11/2019 at the top of my Power BI Report.&lt;/P&gt;&lt;P&gt;I managed to get the Week Number right 102 but unable to work out my way to the Reporting Week Period!&lt;/P&gt;&lt;P&gt;Attached is the screenshot FYR.&lt;/P&gt;&lt;P&gt;Can you please let me know what changes should I be doing to the 'Week Start &amp;amp; End Date' Measure?&lt;/P&gt;&lt;P&gt;Thank heaps.&lt;/P&gt;&lt;P&gt;Kind regards, B&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 03:07:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859136#M6915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-28T03:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859173#M6916</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Please create following measure to get previous week and previous week date range&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PreviousWeek = 
VAR weekNumber = CALCULATE(MAX('CALENDAR 5'[Column]),FILTER('CALENDAR 5','CALENDAR 5'[Date]=TODAY()))
RETURN CONCATENATE("Week",weekNumber-1)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;PrevWeekRange = 
VAR _week = CALCULATE(MAX('CALENDAR 5'[Column]),FILTER('CALENDAR 5','CALENDAR 5'[Date]=TODAY()))-1
VAR _start = CALCULATE(MIN('CALENDAR 5'[Date]),FILTER('CALENDAR 5','CALENDAR 5'[Column]=_week))
VAR _end = CALCULATE(MAX('CALENDAR 5'[Date]),FILTER('CALENDAR 5','CALENDAR 5'[Column]=_week))
RETURN CONCATENATE("Reporting Period",CONCATENATE(_start,CONCATENATE("-",_end)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 04:09:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859173#M6916</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-28T04:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859207#M6918</link>
      <description>&lt;P&gt;HiAnonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're a star mate. Your code is working just perfectly.&lt;/P&gt;&lt;P&gt;One last thing... can I change the format of the Reporting Period dates to read as... DD/MM/YYYY?&lt;/P&gt;&lt;P&gt;Thanks, B&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2019 05:24:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859207#M6918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-28T05:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859267#M6919</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Please use format function to change the date format&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PrevWeekRange = 
VAR _week = CALCULATE(MAX('CALENDAR 5'[Column]),FILTER('CALENDAR 5','CALENDAR 5'[Date]=TODAY()))-1
VAR _start = FORMAT(CALCULATE(MIN('CALENDAR 5'[Date]),FILTER('CALENDAR 5','CALENDAR 5'[Column]=_week)),"dd/MM/yyyy")
VAR _end = FORMAT(CALCULATE(MAX('CALENDAR 5'[Date]),FILTER('CALENDAR 5','CALENDAR 5'[Column]=_week)),"dd/MM/yyyy")
RETURN CONCATENATE("Reporting Period",CONCATENATE(_start,CONCATENATE("-",_end)))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Nov 2019 06:18:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/859267#M6919</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-11-28T06:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Display Current Week Number 99 starting from 03 December 2017 week starting on Monday to Sunday.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/861439#M6975</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your prompt response which has been of great help to me.&lt;/P&gt;&lt;P&gt;Your code works just perfect to suit my needs.&lt;/P&gt;&lt;P&gt;Kind regards, B&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 01:01:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-Current-Week-Number-99-starting-from-03-December-2017/m-p/861439#M6975</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-02T01:01:46Z</dc:date>
    </item>
  </channel>
</rss>

