<?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: MTD total showing Sum for the year instead in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2656329#M78527</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="410720" data-lia-user-login="KW123" class="lia-mention lia-mention-user"&gt;KW123&lt;/a&gt; ,&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2022 18:09:33 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-07-22T18:09:33Z</dc:date>
    <item>
      <title>MTD total showing Sum for the year instead</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2654362#M78364</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a Dates table as well as a separate Goals table. The Goals table contains a list of the 12 months, and a column with each monthly goal.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I need a MTD column in my report that will show the MTD goals added together for the sliced months.&amp;nbsp; So if I have it sliced on May for example, it will show the goal total for Jan-May.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MTD Goal = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TOTALMTD(SUM('2022 Goals'[Goal]),Dates[Date])&lt;BR /&gt;&lt;BR /&gt;However on the report, the Goal comes out as the total for the entire year, no matter which month is sliced.&amp;nbsp; Is there a way to fix this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Jul 2022 22:37:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2654362#M78364</guid>
      <dc:creator>KW123</dc:creator>
      <dc:date>2022-07-21T22:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: MTD total showing Sum for the year instead</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2654614#M78396</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="410720" data-lia-user-login="KW123" class="lia-mention lia-mention-user"&gt;KW123&lt;/a&gt; , First of MTD is only needed when you show data date-wise month onward you can use &lt;/P&gt;
&lt;P&gt;SUM('2022 Goals'[Goal])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or YTD&lt;/P&gt;
&lt;P&gt;YTD Goal =&lt;BR /&gt;TOTALYTD(SUM('2022 Goals'[Goal]),Dates[Date])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or change grand total&lt;/P&gt;
&lt;P&gt;if(isinscope(Table[Visual Column]),&lt;BR /&gt;TOTALMTD(SUM('2022 Goals'[Goal]),Dates[Date]) , SUM('2022 Goals'[Goal]))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/" target="_blank"&gt;https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 03:19:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2654614#M78396</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-07-22T03:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: MTD total showing Sum for the year instead</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2655973#M78490</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;&lt;BR /&gt;Neither of those DAX work for what I am trying to acheive.&amp;nbsp; It is still showing each row as the YTD goal total rather than up to the current month.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 14:39:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2655973#M78490</guid>
      <dc:creator>KW123</dc:creator>
      <dc:date>2022-07-22T14:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: MTD total showing Sum for the year instead</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2655991#M78491</link>
      <description>&lt;P&gt;I've tried it as a running total calculation too, and it just adds all 12 months of goals together instead of just up until the sliced month&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SUM('2022 Goals'[Goal]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;FILTER(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLSELECTED('Dates'[Date]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ISONORAFTER('Dates'[Date], MAX('Dates'[Date]), DESC)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 22 Jul 2022 14:46:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2655991#M78491</guid>
      <dc:creator>KW123</dc:creator>
      <dc:date>2022-07-22T14:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: MTD total showing Sum for the year instead</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2656329#M78527</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="410720" data-lia-user-login="KW123" class="lia-mention lia-mention-user"&gt;KW123&lt;/a&gt; ,&lt;BR /&gt;Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 18:09:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2656329#M78527</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-07-22T18:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: MTD total showing Sum for the year instead</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2663984#M79080</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="410720" data-lia-user-login="KW123" class="lia-mention lia-mention-user"&gt;KW123&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, I create a sample.&lt;/P&gt;
&lt;P&gt;2022 Goals table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Dates table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;The two tables are related with the Month column.&lt;/P&gt;
&lt;P&gt;In your formula, there're two errors, first is the&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/allselected-function-dax" target="_blank"&gt;ALLSELECTED&lt;/A&gt;&amp;nbsp;function, it only takes the values be selected in the slicer into consideration, replace it with&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/all-function-dax" target="_blank"&gt;ALL&lt;/A&gt;&amp;nbsp;function. Then filter the all date table, not only the date column. Modify the formula to:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
CALCULATE (
    SUM ( '2022 Goals'[Goal] ),
    FILTER (
        ALL ( 'Dates' ),
        ISONORAFTER ( 'Dates'[Date], MAX ( 'Dates'[Date] ), DESC )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Get the correct result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 07:06:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-total-showing-Sum-for-the-year-instead/m-p/2663984#M79080</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-07-27T07:06:08Z</dc:date>
    </item>
  </channel>
</rss>

