<?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 measure and Date Filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189624#M18777</link>
    <description>&lt;LI-CODE lang="csharp"&gt;// If you keep the upper bound in your
// selection of dates constant, it does
// not matter what lower bound you select,
// the measure MTD2 will always be the same.
// This is due to how DATESMTD works. If,
// however, the measure changes, it means
// you're not doing something correctly.
// For instance, CalendarTable should be marked
// as the Date table in the model. Please check
// dax.guide/datesmtd to understand how the
// function works. Since the documentation states
// that the function is equivalent to this:
//
//DATESBETWEEN (
//    &amp;lt;Dates&amp;gt;,
//    STARTOFMONTH ( LASTDATE ( &amp;lt;Dates&amp;gt; ) ),
//    LASTDATE ( &amp;lt;Dates&amp;gt; )
//)
//
// it's easy to see that in the calculation
// only the last date, upper bound, plays a role
// (see the dependence only on LASTDATE).
// In a word, the measure below should work
// correctly in the sense that its value does not
// depend on the lower bound of the selection made
// in CalendarTable[Date].

MTD2 =
CALCULATE(
    [MeasureName],
    DATESMTD( CalendarTable[Date] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jun 2020 15:26:34 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-06-29T15:26:34Z</dc:date>
    <item>
      <title>MTD measure and Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189350#M18756</link>
      <description>&lt;P&gt;All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please i have a MTD measure that works fine. I have included this measure in a table visualization. i have a date slicer on my report page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the MTD measure figures to remain unchanged if i apply the date filter.&lt;/P&gt;&lt;P&gt;example if my date slicer is for 1st - 18th June, MTD should display values for June 1st to June 28th.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can this be done, or i am missing something.&lt;/P&gt;&lt;P&gt;Below are my snips.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;MTD measure =&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;MTD2 = Calculate([MeasureName],DATESMTD(CalendarTable[Date]))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your hepl. really appreciate.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 14:08:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189350#M18756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-29T14:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: MTD measure and Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189383#M18760</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to modify your measure as follows:&lt;/P&gt;&lt;PRE&gt;MTD2 = Calculate([MeasureName], FILTER(ALL('YOUR TABLENAME'), DATESMTD(CalendarTable[Date])))&lt;/PRE&gt;&lt;P&gt;Replace 'YOUR TABLENAME' in above dax with your table-name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pragati&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 14:18:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189383#M18760</guid>
      <dc:creator>Pragati11</dc:creator>
      <dc:date>2020-06-29T14:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: MTD measure and Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189413#M18762</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="81077" data-lia-user-login="Pragati11" class="lia-mention lia-mention-user"&gt;Pragati11&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you please explain to me how is this code taken from your formula&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;FILTER(ALL('YOUR TABLENAME'), DATESMTD(CalendarTable[Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;going to work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As far as the documentation for FILTER goes, the second argument must be a BOOLEAN expression that's calculated for each of the rows of the first argument. The second argument, though, is a table in your FILTER, not a bool expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 14:26:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189413#M18762</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-29T14:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: MTD measure and Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189431#M18764</link>
      <description>Anonymous&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;This problem does not have a clear answer because the description is not clear. The fact is that if you change the upper bound of your date range, the measure will always change because it's tied to the calendar. Of course, upper bounds used by a measure can be any functions of the current selection of the dates in the calendar but you have not stated what the upper bound for the measure should really be when you change your selections in the slicer.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Mon, 29 Jun 2020 14:31:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189431#M18764</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-29T14:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: MTD measure and Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189522#M18770</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="81077" data-lia-user-login="Pragati11" class="lia-mention lia-mention-user"&gt;Pragati11&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the above measure and my visualizations couldnt display.&amp;nbsp; I replaced table name with my facts table name as indicated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 14:54:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189522#M18770</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-29T14:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: MTD measure and Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189566#M18774</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply, i have maintained my upper bound at today -1 with the lower bound filtering to any data within the current month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this, the MTD is working fine, but the moment i change the lower bound, MTD changes.&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 15:11:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189566#M18774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-29T15:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: MTD measure and Date Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189624#M18777</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// If you keep the upper bound in your
// selection of dates constant, it does
// not matter what lower bound you select,
// the measure MTD2 will always be the same.
// This is due to how DATESMTD works. If,
// however, the measure changes, it means
// you're not doing something correctly.
// For instance, CalendarTable should be marked
// as the Date table in the model. Please check
// dax.guide/datesmtd to understand how the
// function works. Since the documentation states
// that the function is equivalent to this:
//
//DATESBETWEEN (
//    &amp;lt;Dates&amp;gt;,
//    STARTOFMONTH ( LASTDATE ( &amp;lt;Dates&amp;gt; ) ),
//    LASTDATE ( &amp;lt;Dates&amp;gt; )
//)
//
// it's easy to see that in the calculation
// only the last date, upper bound, plays a role
// (see the dependence only on LASTDATE).
// In a word, the measure below should work
// correctly in the sense that its value does not
// depend on the lower bound of the selection made
// in CalendarTable[Date].

MTD2 =
CALCULATE(
    [MeasureName],
    DATESMTD( CalendarTable[Date] )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;D&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 15:26:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MTD-measure-and-Date-Filters/m-p/1189624#M18777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-29T15:26:34Z</dc:date>
    </item>
  </channel>
</rss>

