<?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: Dynamic 13 weeks based on WEEK SELECTION [DD-MM-YY] in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-13-weeks-based-on-WEEK-SELECTION-DD-MM-YY/m-p/1559533#M30932</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , If need rolling 13 weeks &lt;/P&gt;
&lt;P&gt;Rolling 13 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-13*7,Day))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 13 till last 13 month = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],max(dateadd('Date'[Date],-13*7,Day)),-13*7,Day))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 13 weeks = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]&amp;gt;=max('Date'[Week Rank])-13 &amp;amp;&amp;amp; 'Date'[Week Rank]&amp;lt;=max('Date'[Week Rank])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 13 weeks before 13 = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]&amp;gt;=max('Date'[Week Rank])-26 &amp;amp;&amp;amp; 'Date'[Week Rank]&amp;lt;=max('Date'[Week Rank]) -13 ))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Dec 2020 13:02:08 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2020-12-18T13:02:08Z</dc:date>
    <item>
      <title>Dynamic 13 weeks based on WEEK SELECTION [DD-MM-YY]</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-13-weeks-based-on-WEEK-SELECTION-DD-MM-YY/m-p/1559406#M30930</link>
      <description>&lt;P&gt;Hi Power BI Community&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a dynamic 13 weeks selection based on week DD-MM-YY which should dynamically populate 13 weeks data instead of individual selection.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I check the earlier solved DAX query which is mostly based on 13-weeks selection.&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123&lt;/A&gt;. Thanks [@AmitChandak]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I'm using this DAX which is partially doing the job, where I've to select the whole 13 weeks to achieve the desired output, instead, I need one single selection and it should populate the previous 13 weeks data before that without selecting prior 13 week value in the slicer.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In my use case, I'm using Line and Clustered Column Chart that should dynamically change e.g. when I select Week Commencing e.g. 13-12-2020 (Please note I'm using DD-MM-YY not Week number), it should pull data from 13-12-2020 to 20-09-2020 or if I select 20-12-2020 the data range should be till 27-09-2020 so that I can see how my last 13 sales are doing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As shown in sample datasets and Line &lt;A title="Dynamic 13 weeks based on week selection DD-MM-YY. " href="https://drive.google.com/file/d/1xk1xlvWiFcGTUH_8X_1R5OwwARVm11NP/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1xk1xlvWiFcGTUH_8X_1R5OwwARVm11NP/view?usp=sharing&lt;/A&gt;&amp;nbsp;and Clustered Columncharts. I've attached sample data, DATE table, and DAX measure formula&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 11:51:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-13-weeks-based-on-WEEK-SELECTION-DD-MM-YY/m-p/1559406#M30930</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-18T11:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic 13 weeks based on WEEK SELECTION [DD-MM-YY]</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-13-weeks-based-on-WEEK-SELECTION-DD-MM-YY/m-p/1559533#M30932</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , If need rolling 13 weeks &lt;/P&gt;
&lt;P&gt;Rolling 13 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-13*7,Day))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rolling 13 till last 13 month = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],max(dateadd('Date'[Date],-13*7,Day)),-13*7,Day))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 13 weeks = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]&amp;gt;=max('Date'[Week Rank])-13 &amp;amp;&amp;amp; 'Date'[Week Rank]&amp;lt;=max('Date'[Week Rank])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last 13 weeks before 13 = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]&amp;gt;=max('Date'[Week Rank])-26 &amp;amp;&amp;amp; 'Date'[Week Rank]&amp;lt;=max('Date'[Week Rank]) -13 ))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Dec 2020 13:02:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-13-weeks-based-on-WEEK-SELECTION-DD-MM-YY/m-p/1559533#M30932</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-12-18T13:02:08Z</dc:date>
    </item>
  </channel>
</rss>

