<?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: Week to Date Cumulative Totals not resetting in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145159#M17247</link>
    <description>&lt;P&gt;OK, so close... It was the minimum date causing the error. You got me on the right track and I came up with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;WE Total Hours = 
CALCULATE(
	[Hours],
	FILTER(
		ALLSELECTED('Dates'[Date]),
		IF(DATEDIFF((Dates[Date] - WEEKDAY('Dates'[Date],2)),MAX(Dates[Date]),DAY)&amp;gt;7,
            'Dates'[Date] &amp;gt;= (7 + Dates[Date] - WEEKDAY('Dates'[Date],2)), 
            'Dates'[Date] &amp;gt;= (Dates[Date] - WEEKDAY('Dates'[Date],2))) &amp;amp;&amp;amp; 
        'Dates'[Date] &amp;lt;= MAX(Dates[Date])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The world is right again! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 06 Jun 2020 01:07:59 GMT</pubDate>
    <dc:creator>luccketta</dc:creator>
    <dc:date>2020-06-06T01:07:59Z</dc:date>
    <item>
      <title>Week to Date Cumulative Totals not resetting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1144264#M17192</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a measure that is attempting to return total hours per week. My slicer is filtering on pay period which is bi-weekly. The total is working fine for the first week in the pay period however it is not resetting to zero when it gets to the second week of the pay period but instead continues the cumulative. I'm guessing it may have something to do with the pay period coming from my DATA table rather than my DATE table but I can't be sure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your guidance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;WE Total Hours = 
CALCULATE(
	[Hours],
	FILTER(
		ALLSELECTED('Dates'[Date]),
		'Dates'[Date] &amp;gt;= (Dates[Date] - WEEKDAY('Dates'[Date],2)) &amp;amp;&amp;amp; 
        'Dates'[Date] &amp;lt;= MAX('Dates'[Date])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 12:10:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1144264#M17192</guid>
      <dc:creator>luccketta</dc:creator>
      <dc:date>2020-06-05T12:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Week to Date Cumulative Totals not resetting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1144997#M17239</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How does your data model look like?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 20:04:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1144997#M17239</guid>
      <dc:creator>stevedep</dc:creator>
      <dc:date>2020-06-05T20:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Week to Date Cumulative Totals not resetting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145011#M17242</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236308" data-lia-user-login="luccketta" class="lia-mention lia-mention-user"&gt;luccketta&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See this blog on Weeks.&lt;/P&gt;&lt;P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also Weekday returns an integer, so in the formula you are subtracting a date and an integer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 20:13:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145011#M17242</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-05T20:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Week to Date Cumulative Totals not resetting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145096#M17243</link>
      <description>&lt;P&gt;Steve, here is my Data Model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 22:17:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145096#M17243</guid>
      <dc:creator>luccketta</dc:creator>
      <dc:date>2020-06-05T22:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Week to Date Cumulative Totals not resetting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145100#M17244</link>
      <description>&lt;P&gt;Harsh,&amp;nbsp;&lt;SPAN&gt;thanks for your reply!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Weekday returns an integer, so in the formula you are subtracting a date and an integer",&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I was trying to set the minimum date to the start of the week (Monday) of the filter context.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I can get total hours for the current week of the row shown Monday through Sunday.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The blog has good stuff but I can't figure how the RANK will get me to the finish line.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 22:24:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145100#M17244</guid>
      <dc:creator>luccketta</dc:creator>
      <dc:date>2020-06-05T22:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Week to Date Cumulative Totals not resetting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145152#M17246</link>
      <description>&lt;P&gt;The second term in your Filter ( the MAX expression) is going to the end of the two-week period I believe.&amp;nbsp; Make your second comparison like the first so it calculated dynamically.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LDates[Date]+7-WEEKDAY(Dates[Date],2)&amp;nbsp; // or maybe +6 but you get the idea&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this works for you, please mark it as the solution.&amp;nbsp; Kudos are appreciated too.&amp;nbsp; Please let me know if not.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 00:44:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145152#M17246</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-06-06T00:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Week to Date Cumulative Totals not resetting</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145159#M17247</link>
      <description>&lt;P&gt;OK, so close... It was the minimum date causing the error. You got me on the right track and I came up with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;WE Total Hours = 
CALCULATE(
	[Hours],
	FILTER(
		ALLSELECTED('Dates'[Date]),
		IF(DATEDIFF((Dates[Date] - WEEKDAY('Dates'[Date],2)),MAX(Dates[Date]),DAY)&amp;gt;7,
            'Dates'[Date] &amp;gt;= (7 + Dates[Date] - WEEKDAY('Dates'[Date],2)), 
            'Dates'[Date] &amp;gt;= (Dates[Date] - WEEKDAY('Dates'[Date],2))) &amp;amp;&amp;amp; 
        'Dates'[Date] &amp;lt;= MAX(Dates[Date])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The world is right again! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jun 2020 01:07:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Week-to-Date-Cumulative-Totals-not-resetting/m-p/1145159#M17247</guid>
      <dc:creator>luccketta</dc:creator>
      <dc:date>2020-06-06T01:07:59Z</dc:date>
    </item>
  </channel>
</rss>

