<?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: How to create a measure that will filter to last month and the month befores data? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3202505#M116465</link>
    <description>&lt;P&gt;They are not regular measures, they are calculation items. You need to use Tabular Editor to create a calculation group and then add the above code as calculation items. You can then add the calculation group to the filter for your visuals and choose the appropriate calculation item.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 09:22:29 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2023-04-24T09:22:29Z</dc:date>
    <item>
      <title>How to create a measure that will filter to last month and the month befores data?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3200324#M116313</link>
      <description>&lt;P&gt;I have measures allready created which shows percentage data, what I am wanting is 3 cards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A card that shows this currents calendar months percentage data.&lt;/P&gt;&lt;P&gt;A card that shows&amp;nbsp;the last calendar months percentage data.&lt;/P&gt;&lt;P&gt;A card that shows&amp;nbsp;the previous calendar months percentage data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now the data I have does go over previous fiscal years. I am assuming the measure that will be created for the 3 above can simply be dragged and dropped on to the "Filters to visual" which will allow these to be done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The objective here is these for these to automaticly calculate this month, last month and previous to last months data without the need for manual change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 15:00:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3200324#M116313</guid>
      <dc:creator>alexw94</dc:creator>
      <dc:date>2023-04-21T15:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a measure that will filter to last month and the month befores data?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3200365#M116315</link>
      <description>&lt;P&gt;I would create a calculation group with 3 calculation items, then put that calculation group on the card visuals and pick the appropriate item.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current Calendar Month =
CALCULATE (
    SELECTEDMEASURE (),
    CALCULATETABLE (
        DATESMTD ( 'Remote Date'[Date] ),
        TREATAS ( { TODAY () }, 'Remote Date'[Date] )
    )
)

Last Calendar Month =
VAR CurrentDate =
    TODAY ()
VAR StartLastMonth =
    EOMONTH ( CurrentDate, -2 ) + 1
VAR EndLastMonth =
    EOMONTH ( StartLastMonth, 0 )
RETURN
    CALCULATE (
        SELECTEDMEASURE (),
        DATESBETWEEN ( 'Date'[Date], StartLastMonth, EndLastMonth )
    )

Prev Calendar Month =
VAR CurrentDate =
    TODAY ()
VAR StartPrevMonth =
    EOMONTH ( CurrentDate, -3 ) + 1
VAR EndPrevMonth =
    EOMONTH ( StartLastMonth, 0 )
RETURN
    CALCULATE (
        SELECTEDMEASURE (),
        DATESBETWEEN ( 'Date'[Date], StartPrevMonth, EndPrevMonth )
    )
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 21 Apr 2023 15:17:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3200365#M116315</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-04-21T15:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a measure that will filter to last month and the month befores data?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3200403#M116318</link>
      <description>&lt;P&gt;Try the WINDOW() Dax.&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/dax/window-function-dax" target="_blank"&gt;WINDOW function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 15:29:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3200403#M116318</guid>
      <dc:creator>yyzheng12</dc:creator>
      <dc:date>2023-04-21T15:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a measure that will filter to last month and the month befores data?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3202285#M116451</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp; - I have tried using the above measures but they have not worked. I have added in the measures that are appropiate for my report at the DATESBETWEEN bit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also where it is SELECTRED MEASURE... am I suppose to be putting in the measure I am want calculating for the previous/current months data between those brackets?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 07:35:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3202285#M116451</guid>
      <dc:creator>alexw94</dc:creator>
      <dc:date>2023-04-24T07:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a measure that will filter to last month and the month befores data?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3202505#M116465</link>
      <description>&lt;P&gt;They are not regular measures, they are calculation items. You need to use Tabular Editor to create a calculation group and then add the above code as calculation items. You can then add the calculation group to the filter for your visuals and choose the appropriate calculation item.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 09:22:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3202505#M116465</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-04-24T09:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a measure that will filter to last month and the month befores data?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3202992#M116521</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp;I am restricted so therefore cannot use the Tabular Editor. If you or anyone knows of any alternate ways I can do this, then please let me know.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 13:28:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3202992#M116521</guid>
      <dc:creator>alexw94</dc:creator>
      <dc:date>2023-04-24T13:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a measure that will filter to last month and the month befores data?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3203002#M116523</link>
      <description>&lt;P&gt;You'll could create separate measures for each. Just replace SELECTEDMEASURE() in my code with the actual measure you want to calculate.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 13:32:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-create-a-measure-that-will-filter-to-last-month-and-the/m-p/3203002#M116523</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2023-04-24T13:32:57Z</dc:date>
    </item>
  </channel>
</rss>

