<?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 for Custom Filter to Select Past Months &amp;amp; Current Month's Latest Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116562#M16311</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="212991" data-lia-user-login="bboobe" class="lia-mention lia-mention-user"&gt;bboobe&lt;/a&gt;&amp;nbsp;If I am understanding correctly then see below. Updated PBIX attached.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 2 = 
  VAR __Measure = DIVIDE(DISTINCTCOUNT('sample'[Dept]),CALCULATE(DISTINCTCOUNT('sample'[Dept]),ALL('sample'[Status])))
  VAR __MaxDateCurrentMonth = MAXX(FILTER(ALL('sample'),MONTH([Month]) = MONTH(TODAY()) &amp;amp;&amp;amp; YEAR([Month]) = YEAR(TODAY())),[Month])
  VAR __Current = MAXX(FILTER('sample',[Month] = __MaxDateCurrentMonth),[Latest Data])
RETURN
  IF(MONTH(MAX([Month])) = MONTH(TODAY()) &amp;amp;&amp;amp; YEAR(MAX([Month])) = YEAR(TODAY()),
        IF(MAX([Month]) = __MaxDateCurrentMonth,__Measure,BLANK()),
        __Measure
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 May 2020 15:16:10 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-05-24T15:16:10Z</dc:date>
    <item>
      <title>DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116247#M16279</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://drive.google.com/file/d/1ZBTilbeJxPISCZsqlv3FH2Qffvz09k1a/view?usp=drivesdk" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1ZBTilbeJxPISCZsqlv3FH2Qffvz09k1a/view?usp=drivesdk&lt;/A&gt;&lt;BR /&gt;This is a sample of my dataset. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When data is refreshed today (May 24), data will be available until the previous day (May 23). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for the &lt;STRONG&gt;current month&lt;/STRONG&gt;, data will be updated incrementally (&lt;STRONG&gt;day wise status&lt;/STRONG&gt;). for example - for all departments, I have day wise status. (May 1, May 2, May 3, May 4..... May 31 )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;At the &lt;STRONG&gt;end of the current month&lt;/STRONG&gt; - May, &lt;STRONG&gt;day-wise status is deleted&lt;/STRONG&gt; and &lt;STRONG&gt;only May 31 status (final for the month&lt;/STRONG&gt;) is stored and the day wise status is started for June. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to show Past months &amp;amp; Current Month -latest date status for monthly trend visual. Currently, I have put "Latest data" in &lt;/SPAN&gt;&lt;STRONG&gt;Filters &lt;/STRONG&gt;&lt;SPAN&gt;and Selecting past months and "Latest data". &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Issue&lt;/STRONG&gt; - At the beginning of Next Month, the Filter does not include "&lt;/SPAN&gt;&lt;STRONG&gt;May data"&lt;/STRONG&gt;&lt;SPAN&gt; and I have to be select manually.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How to achieve automating this selection so that all past months are selected automatically along with Current Month Latest date?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2020 09:37:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116247#M16279</guid>
      <dc:creator>bboobe</dc:creator>
      <dc:date>2020-05-24T09:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116256#M16280</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="212991" data-lia-user-login="bboobe" class="lia-mention lia-mention-user"&gt;bboobe&lt;/a&gt;&amp;nbsp;You want what I refer to as a Complex Selector. The concept is based upon the Inverse Selector. &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Inverse-Selector/m-p/648290#M325" target="_blank" rel="noopener"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Inverse-Selector/m-p/648290#M325&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The concept is that you create a measure that returns 1 or 0 based upon whatever logical criteria makes sense in your situation. So, you would likely create a measure like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Selection Measure = IF(MONTH(MAX([Month])) = MONTH(TODAY()) &amp;amp;&amp;amp; YEAR(MAX([Month])) = YEAR(TODAY()),0,1)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can just filter for 1 or 0 depending on what you want. Updated PBIX is attached.&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2020 09:56:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116256#M16280</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-24T09:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116287#M16286</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, Thanks for looking into it. But in my case, I would require &lt;STRONG&gt;both past months &amp;amp; Current Month (max date data)&lt;/STRONG&gt;&amp;nbsp;to&amp;nbsp;be in display. Like the below screenshot&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>Sun, 24 May 2020 10:57:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116287#M16286</guid>
      <dc:creator>bboobe</dc:creator>
      <dc:date>2020-05-24T10:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116403#M16287</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="212991" data-lia-user-login="bboobe" class="lia-mention lia-mention-user"&gt;bboobe&lt;/a&gt;&amp;nbsp;so then don't use any filter at all?&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2020 11:17:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116403#M16287</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-24T11:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116478#M16291</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; &amp;nbsp;For Past Months, I have one time (last day of month) data and For Current Month, I have day-wise data (May 1, May 2.... May 23) and i want to show latest data for current month.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2020 11:49:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116478#M16291</guid>
      <dc:creator>bboobe</dc:creator>
      <dc:date>2020-05-24T11:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116562#M16311</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="212991" data-lia-user-login="bboobe" class="lia-mention lia-mention-user"&gt;bboobe&lt;/a&gt;&amp;nbsp;If I am understanding correctly then see below. Updated PBIX attached.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 2 = 
  VAR __Measure = DIVIDE(DISTINCTCOUNT('sample'[Dept]),CALCULATE(DISTINCTCOUNT('sample'[Dept]),ALL('sample'[Status])))
  VAR __MaxDateCurrentMonth = MAXX(FILTER(ALL('sample'),MONTH([Month]) = MONTH(TODAY()) &amp;amp;&amp;amp; YEAR([Month]) = YEAR(TODAY())),[Month])
  VAR __Current = MAXX(FILTER('sample',[Month] = __MaxDateCurrentMonth),[Latest Data])
RETURN
  IF(MONTH(MAX([Month])) = MONTH(TODAY()) &amp;amp;&amp;amp; YEAR(MAX([Month])) = YEAR(TODAY()),
        IF(MAX([Month]) = __MaxDateCurrentMonth,__Measure,BLANK()),
        __Measure
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 May 2020 15:16:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1116562#M16311</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-24T15:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1118837#M16455</link>
      <description>&lt;P&gt;Thank you &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;!&amp;nbsp; But I need this as a measure that can be applied in &lt;STRONG&gt;Filter&lt;/STRONG&gt;.. as I have other visuals (table view for reports) that needs to be applied with this time filter.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 06:25:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1118837#M16455</guid>
      <dc:creator>bboobe</dc:creator>
      <dc:date>2020-05-26T06:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1120319#M16487</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="212991" data-lia-user-login="bboobe" class="lia-mention lia-mention-user"&gt;bboobe&lt;/a&gt;&amp;nbsp;That should be something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 3 = 
    VAR __Month = MAX('sample'[Month])
    VAR __MaxDateCurrentMonth = MAXX(FILTER(ALL('sample'),MONTH([Month]) = MONTH(TODAY()) &amp;amp;&amp;amp; YEAR([Month]) = YEAR(TODAY())),[Month])
    VAR __IsCurrentMonth = IF(MONTH(__Month) = MONTH(TODAY()) &amp;amp;&amp;amp; YEAR(__Month) = YEAR(TODAY()),TRUE(),FALSE())
RETURN
    IF(
        __IsCurrentMonth,
        IF(__Month = __MaxDateCurrentMonth,1,0),
        1
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 May 2020 13:36:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1120319#M16487</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-26T13:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1120406#M16492</link>
      <description>&lt;P&gt;Thank you VERY MUCH&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 14:29:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1120406#M16492</guid>
      <dc:creator>bboobe</dc:creator>
      <dc:date>2020-05-26T14:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1120413#M16494</link>
      <description>Sorry it took us some time to get there &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="212991" data-lia-user-login="bboobe" class="lia-mention lia-mention-user"&gt;bboobe&lt;/a&gt; !</description>
      <pubDate>Tue, 26 May 2020 14:33:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1120413#M16494</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-26T14:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: DAX for Custom Filter to Select Past Months &amp; Current Month's Latest Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1120424#M16495</link>
      <description>&lt;P&gt;Yeah &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, I am glad this is solved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; and I appreciate your patience on solving this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you for your time, you're awesome!&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 14:38:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-for-Custom-Filter-to-Select-Past-Months-amp-Current-Month-s/m-p/1120424#M16495</guid>
      <dc:creator>bboobe</dc:creator>
      <dc:date>2020-05-26T14:38:54Z</dc:date>
    </item>
  </channel>
</rss>

