<?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: Dax formula for &amp;quot;4 Weeks to Date&amp;quot; (I have 1WTD) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1333696#M23690</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="133502" data-lia-user-login="michellepace" class="lia-mention lia-mention-user"&gt;michellepace&lt;/a&gt;&amp;nbsp;- First, you probably want something like Rolling Weeks -&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694#M128" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694#M128&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you might find Sequential helpful -&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231#M116" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231#M116&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Aug 2020 18:38:05 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-08-29T18:38:05Z</dc:date>
    <item>
      <title>Dax formula for "4 Weeks to Date" (I have 1WTD)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1333622#M23680</link>
      <description>&lt;P&gt;Hi there. In the first image below I have plotted "One Week to Date (&lt;STRONG&gt;1WTD&lt;/STRONG&gt;)" sales and "Month to Date (&lt;STRONG&gt;MTD&lt;/STRONG&gt;)" sales. I would like to replace MTD with "4 weeks to date (&lt;STRONG&gt;4WTD&lt;/STRONG&gt;)". I would then get a consistent pattern as illustrated in image 2 (where I hand drew 4WTD).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question: &lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Could someone please &lt;STRONG&gt;help me with the DAX code for "4WTD"&lt;/STRONG&gt; similar to my 1WTD formula?&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Dataset &amp;amp; .pbix:&lt;/STRONG&gt;&amp;nbsp;&lt;A href="http://michellepace.com/pics/Q.10%20Working%20in%20buckets%20of%20weeks%20-%20translate%20MTD%2C%20QTD.zip" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;&lt;FONT size="1 2 3 4 5 6 7" color="#FF00FF"&gt;(dataset from Enterprise DNA's &lt;A href="https://portal.enterprisedna.co/p/ultimate-beginners-guide-to-dax" target="_self"&gt;Ultimate Beginners Guide to Dax&lt;/A&gt;)&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;1WTD formula:&amp;nbsp;&lt;/STRONG&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;FONT size="1 2 3 4 5 6 7" color="#FF00FF"&gt;(formula from&amp;nbsp;&lt;A href="https://radacad.com/week-to-date-calculation-in-power-bi-with-dax" target="_self"&gt;RADCAD's tutorial&lt;/A&gt;&amp;nbsp;) &lt;/FONT&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-60px"&gt;&lt;img /&gt;&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As always, thank you.&lt;BR /&gt;Michelle&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 07:05:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1333622#M23680</guid>
      <dc:creator>michellepace</dc:creator>
      <dc:date>2020-08-31T07:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula for "4 Weeks to Date" (I have 1WTD)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1333696#M23690</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="133502" data-lia-user-login="michellepace" class="lia-mention lia-mention-user"&gt;michellepace&lt;/a&gt;&amp;nbsp;- First, you probably want something like Rolling Weeks -&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694#M128" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Rolling-Weeks/m-p/391694#M128&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you might find Sequential helpful -&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231#M116" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Sequential/m-p/380231#M116&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2020 18:38:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1333696#M23690</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-08-29T18:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula for "4 Weeks to Date" (I have 1WTD)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1333947#M23703</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="133502" data-lia-user-login="michellepace" class="lia-mention lia-mention-user"&gt;michellepace&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please find below the measures that calculates&amp;nbsp; One Week-To-Date and&amp;nbsp; Four&amp;nbsp;Week-To-Date. I used my approach for One Week To Date as it will dynamically change the week based on the current date selection range.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;New Sales 1WTD = 
var CurrentDate=LASTDATE(Dates[Date])
var DayOne = CALCULATE(MIN(Dates[Date]),WEEKDAY(Dates[Date],3)=0,ALLSELECTED(Dates[Date]))
var FourWeekStart = MAXX(GENERATESERIES(DayOne,CurrentDate,7),[Value])
return
CALCULATE(
    [Total Sales],
    FILTER(
        ALLSELECTED(Dates[Date]),
        Dates[Date] &amp;gt;= FourWeekStart &amp;amp;&amp;amp; Dates[Date] &amp;lt;= CurrentDate)
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;New Sales 4WTD = 
var CurrentDate=LASTDATE(Dates[Date])
var DayOne = CALCULATE(MIN(Dates[Date]),WEEKDAY(Dates[Date],3)=0,ALLSELECTED(Dates[Date]))
var FourWeekStart = MAXX(GENERATESERIES(DayOne,CurrentDate,28),[Value])
return
CALCULATE(
    [Total Sales],
    FILTER(
        ALLSELECTED(Dates[Date]),
        Dates[Date] &amp;gt;= FourWeekStart &amp;amp;&amp;amp; Dates[Date] &amp;lt;= CurrentDate)
)&lt;/LI-CODE&gt;&lt;P&gt;________________________&lt;/P&gt;&lt;P&gt;If my answer was helpful, please consider &lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&lt;I&gt; to help the other members find it&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Click on the &lt;STRONG&gt;Thumbs-Up icon &lt;/STRONG&gt;if you like this reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/channel/UCKwBEguA8IlBubIobaOormg?sub_confirmation=1" target="_blank"&gt;&lt;FONT color="blue"&gt;YouTube&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; &lt;A href="https://linkedin.com/in/fowmy" target="_blank"&gt;&lt;FONT color="blue"&gt;LinkedIn&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 07:26:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1333947#M23703</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-08-30T07:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula for "4 Weeks to Date" (I have 1WTD)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1335060#M23745</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="133502" data-lia-user-login="michellepace" class="lia-mention lia-mention-user"&gt;michellepace&lt;/a&gt; , please refer my blog on WTD/week&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3" target="_blank"&gt;https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3&lt;/A&gt;&lt;BR /&gt;&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;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 06:36:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1335060#M23745</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-31T06:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula for "4 Weeks to Date" (I have 1WTD)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1335120#M23748</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="52518" data-lia-user-login="Fowmy" class="lia-mention lia-mention-user"&gt;Fowmy&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;You've done it again, thank you so very much! I have uploaded the solution file &lt;A href="http://michellepace.com/pics/Q.10%20Working%20in%20buckets%20of%20weeks%20-%20translate%20MTD%2C%20QTD.zip" target="_self"&gt;here&lt;/A&gt;, in case it is useful to anyone else. This is what it looks like:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's going to take me a little while to pick through your equations to understand and learn from them. Is there a way I can "step-through" them and see the values of the variables as the equation evaluates? Would I need to use something like Dax Studio to do this? (I've only heard of it, never used it)&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 07:38:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1335120#M23748</guid>
      <dc:creator>michellepace</dc:creator>
      <dc:date>2020-08-31T07:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula for "4 Weeks to Date" (I have 1WTD)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1335133#M23750</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="133502" data-lia-user-login="michellepace" class="lia-mention lia-mention-user"&gt;michellepace&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Glad it worked for!&lt;BR /&gt;&lt;BR /&gt;Follow these links to learn how to step through DAX codes and even debug them. I mostly use CONCATENATEX and COMBINEVALUES.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=9SV2VnYbgg4" target="_blank"&gt;https://www.youtube.com/watch?v=9SV2VnYbgg4&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/some-simple-ways-to-debug-your-dax-measure-code-in-power-bi-debugging-virtual-tables" target="_blank"&gt;https://radacad.com/some-simple-ways-to-debug-your-dax-measure-code-in-power-bi-debugging-virtual-tables&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Good Luck&lt;BR /&gt;Fowmy&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 07:07:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1335133#M23750</guid>
      <dc:creator>Fowmy</dc:creator>
      <dc:date>2020-08-31T07:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dax formula for "4 Weeks to Date" (I have 1WTD)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1341712#M23994</link>
      <description>&lt;P&gt;For anyone interested - the youtube video Fowny recommends above (10 minutes from guy in a cube) is EXCELLENT.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 15:17:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-formula-for-quot-4-Weeks-to-Date-quot-I-have-1WTD/m-p/1341712#M23994</guid>
      <dc:creator>michellepace</dc:creator>
      <dc:date>2020-09-02T15:17:41Z</dc:date>
    </item>
  </channel>
</rss>

