<?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 MTH and YTD Sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTH-and-YTD-Sales/m-p/2560113#M72800</link>
    <description>&lt;P&gt;I have a excel datasouce from Col A to Col Z, Col. X contains the monthly data in MM.YYYY format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Dashbard I need to add dropdown or check box as "MTD" Month to Date, and "YTD" Year to Date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Excel we used to write a formula to provide the MTD based on the month from Current date function and for Year to date being less than and equal to month from curent date function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we are migrating to Power BI and need to know if we can implement this in excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Justin..&lt;/P&gt;</description>
    <pubDate>Mon, 06 Jun 2022 05:11:34 GMT</pubDate>
    <dc:creator>Justin27</dc:creator>
    <dc:date>2022-06-06T05:11:34Z</dc:date>
    <item>
      <title>MTH and YTD Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTH-and-YTD-Sales/m-p/2560113#M72800</link>
      <description>&lt;P&gt;I have a excel datasouce from Col A to Col Z, Col. X contains the monthly data in MM.YYYY format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the Dashbard I need to add dropdown or check box as "MTD" Month to Date, and "YTD" Year to Date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Excel we used to write a formula to provide the MTD based on the month from Current date function and for Year to date being less than and equal to month from curent date function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now we are migrating to Power BI and need to know if we can implement this in excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Justin..&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 05:11:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTH-and-YTD-Sales/m-p/2560113#M72800</guid>
      <dc:creator>Justin27</dc:creator>
      <dc:date>2022-06-06T05:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: MTH and YTD Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTH-and-YTD-Sales/m-p/2560723#M72834</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="397671" data-lia-user-login="Justin27" class="lia-mention lia-mention-user"&gt;Justin27&lt;/a&gt; , create a date using MM.YYYY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date =&amp;nbsp; #date(right([Month],4), left([Month,2),1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can use time intelligence with date tbale&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))&lt;BR /&gt;YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or today vs max selected&lt;/P&gt;
&lt;P&gt;YTD = &lt;BR /&gt;var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())&lt;BR /&gt;var _min = eomonth(_max,-1*MONTH(_max))+1 &lt;BR /&gt;return&lt;BR /&gt;CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MTD = &lt;BR /&gt;var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())&lt;BR /&gt;var _min = eomonth(_max,-1)+1 ,&lt;BR /&gt;return&lt;BR /&gt;CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Refer the code with slicer&lt;/P&gt;
&lt;P&gt;&lt;A href="https://medium.com/chandakamit/power-bi-when-i-felt-lazy-and-i-needed-too-many-measures-ed8de20d9f79" target="_blank"&gt;https://medium.com/chandakamit/power-bi-when-i-felt-lazy-and-i-needed-too-many-measures-ed8de20d9f79&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :&lt;A href="https://youtu.be/OBf0rjpp5Hw" target="_blank" rel="noopener"&gt;https://youtu.be/OBf0rjpp5Hw&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4" target="_blank" rel="noopener"&gt;https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4&lt;/A&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank" rel="noopener"&gt;radacad&lt;/A&gt; &lt;A href="https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/" target="_blank" rel="noopener"&gt;sqlbi&lt;/A&gt; &lt;A href="https://www.youtube.com/playlist?list=PLPaNVDMhUXGYLz-w8ERQOo3KYARs7GgG-" target="_blank" rel="noopener"&gt;My Video Series&lt;/A&gt; Appreciate your Kudos. &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 09:19:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTH-and-YTD-Sales/m-p/2560723#M72834</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-06-06T09:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: MTH and YTD Sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTH-and-YTD-Sales/m-p/2568792#M73274</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="397671" data-lia-user-login="Justin27" class="lia-mention lia-mention-user"&gt;Justin27&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you want calculate the MTD and YTD in Power BI?&lt;/P&gt;
&lt;P&gt;If so, you could refer this blog:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.mssqltips.com/sqlservertip/4841/calculating-mtd-qtd-ytd-running-and-cumulative-total-in-power-bi/" target="_self"&gt;https://www.mssqltips.com/sqlservertip/4841/calculating-mtd-qtd-ytd-running-and-cumulative-total-in-power-bi/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want detailed formula, please share some sample data and expected result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jay&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 09:55:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTH-and-YTD-Sales/m-p/2568792#M73274</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-09T09:55:58Z</dc:date>
    </item>
  </channel>
</rss>

