<?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 measure - Stop the Line chart at current week for YTD Sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-Stop-the-Line-chart-at-current-week-for-YTD-Sales/m-p/1775049#M37203</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; - Your DAX solution worked magically, Appreciate your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this one to get the solution for future reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;--------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;YTD QTY forced 2 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var _max = today()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if(max('Date'[Date])&amp;lt;=_max, calculate(Sum(SCE[Sales $]),DATESYTD('Date'[Date])), blank())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;--------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;View (All Year YTD) 2 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR YearsBack = year(today()) - SELECTEDVALUE('Year'[Year])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE([YTD QTY forced 2],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATEADD('Date'[Date], -YearsBack, YEAR)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;--------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 08 Apr 2021 16:46:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-04-08T16:46:41Z</dc:date>
    <item>
      <title>DAX measure - Stop the Line chart at current week for YTD Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-Stop-the-Line-chart-at-current-week-for-YTD-Sales/m-p/1773913#M37169</link>
      <description>&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can see all last three YTD 2018, 2019, 2020 are plotted on the single graph to compare against 2021 YTD. The desired output that i like to achieve is to stop at current week the line graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached PBIX and used DAX syntax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1KfQfWMP3eKebZoF7R2Xmz6Cce4RXsSKD/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1KfQfWMP3eKebZoF7R2Xmz6Cce4RXsSKD/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;&lt;SPAN&gt;SCE_Sales $ = SUMX(SCE,SCE[Sales $])&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;2.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;SCE YTD $ = TOTALYTD([SCE_Sales $],'Date'[Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3. View (All Year YTD) = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR YearsBack = year(today()) - SELECTEDVALUE('Year'[Year])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE([Electric YTD kWh],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATEADD('Date'[Date], -YearsBack, YEAR)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Presently the current year YTD sales are only populated up to week 15 because weeks 16 – 52 have not happened yet (when the report was first build). From Week 16 2021 sales are showing flat-lining till week 52 which is misleading.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I tweak the current DAX to stop (RED CIRCLED) from week 15 the 2021 YTD Black line?&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;Would be very grateful if you can help me with modifying my current DAX or new DAX suggestion to stop at week 15 the 2021 YTD Blank line?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 08:44:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-Stop-the-Line-chart-at-current-week-for-YTD-Sales/m-p/1773913#M37169</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-08T08:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure - Stop the Line chart at current week for YTD Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-Stop-the-Line-chart-at-current-week-for-YTD-Sales/m-p/1774019#M37172</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , Try to force YTD to stop&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examples&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;YTD QTY forced= &lt;BR /&gt;var _max1 = today() //or maxx(allselected('Order'),'order'[Date])&lt;BR /&gt;var _max = format(_max,"MMDD")&lt;BR /&gt;return&lt;BR /&gt;calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),filter('Date', format('Date'[Date],"MMDD")&amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;YTD QTY forced= &lt;BR /&gt;var _max = today()&lt;BR /&gt;return&lt;BR /&gt;if(max('Date'[Date])&amp;lt;=_max, calculate(Sum('order'[Qty]),DATESYTD('Date'[Date])), blank())&lt;BR /&gt;//or&lt;BR /&gt;//calculate(Sum('order'[Qty]),DATESYTD('Date'[Date]),filter('Date','Date'[Date]&amp;lt;=_max))&lt;BR /&gt;//calculate(TOTALYTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]&amp;lt;=_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LYTD QTY forced= &lt;BR /&gt;var _max = date(year(today())-1,month(today()),day(today()))&lt;BR /&gt;return&lt;BR /&gt;if(max('Date'[Date])&amp;lt;=_max, CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]&amp;lt;=_max), blank())&lt;BR /&gt;//OR&lt;BR /&gt;//CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year)),'Date'[Date]&amp;lt;=_max)&lt;BR /&gt;//TOTALYTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]&amp;lt;=_max)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 09:22:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-Stop-the-Line-chart-at-current-week-for-YTD-Sales/m-p/1774019#M37172</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-04-08T09:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAX measure - Stop the Line chart at current week for YTD Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-Stop-the-Line-chart-at-current-week-for-YTD-Sales/m-p/1775049#M37203</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; - Your DAX solution worked magically, Appreciate your help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this one to get the solution for future reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;--------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;YTD QTY forced 2 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var _max = today()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if(max('Date'[Date])&amp;lt;=_max, calculate(Sum(SCE[Sales $]),DATESYTD('Date'[Date])), blank())&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;--------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;View (All Year YTD) 2 = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR YearsBack = year(today()) - SELECTEDVALUE('Year'[Year])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE([YTD QTY forced 2],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATEADD('Date'[Date], -YearsBack, YEAR)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;--------------------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Apr 2021 16:46:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-measure-Stop-the-Line-chart-at-current-week-for-YTD-Sales/m-p/1775049#M37203</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-08T16:46:41Z</dc:date>
    </item>
  </channel>
</rss>

