<?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: Last 12 months based on Year and Month Name selection in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3076907#M107013</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469112" data-lia-user-login="amehrosh" class="lia-mention lia-mention-user"&gt;amehrosh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please create measure with below dax formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR cur_year =
    SELECTEDVALUE ( 'Table 2'[Year] )
VAR cur_month =
    SELECTEDVALUE ( 'Table 3'[Month] )
VAR _month =
    SWITCH (
        cur_month,
        "Jan", 1,
        "Feb", 2,
        "Mar", 3,
        "Apr", 4,
        "May", 5,
        "Jun", 6,
        "Jul", 7,
        "Aug", 8,
        "Sep", 9,
        "Oct", 10,
        "Nov", 11,
        "Dec", 12
    )
VAR max_date =
    DATE ( cur_year, _month, 1 )
VAR tmp =
    DATESINPERIOD ( 'Table 4'[Date], max_date, -12, MONTH )
VAR cur_date =
    SELECTEDVALUE ( 'Table'[Date] )
RETURN
    IF ( cur_date IN tmp, 1 )
&lt;/LI-CODE&gt;
&lt;P&gt;Add a matrix visual and add this measure to filter pane and apply:&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;
&lt;P&gt;For more details, please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_Binbin Yu&lt;BR /&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2023 03:08:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-02-13T03:08:15Z</dc:date>
    <item>
      <title>Last 12 months based on Year and Month Name selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3074028#M106807</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;&lt;BR /&gt;I have a requirement wherein client wants to see last 12 months data based on the selected Year and Month Name selection.&lt;BR /&gt;&lt;BR /&gt;Suppose if I select 2023 in Year and Month Name as Jan, then it should show us the data from Jan 2023 to Feb 2022 i.e.12 months.&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated.&lt;BR /&gt;Thanks,&lt;BR /&gt;Alina&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 09:00:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3074028#M106807</guid>
      <dc:creator>amehrosh</dc:creator>
      <dc:date>2023-02-10T09:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 months based on Year and Month Name selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3074204#M106818</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469112" data-lia-user-login="amehrosh" class="lia-mention lia-mention-user"&gt;amehrosh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it seems you expect a measure. How do you plan to showcase this measure? What context do you have, like axis, row/column of a visual?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 09:54:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3074204#M106818</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-10T09:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 months based on Year and Month Name selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3074248#M106821</link>
      <description>&lt;P&gt;measure to show in a matrix.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 10:08:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3074248#M106821</guid>
      <dc:creator>amehrosh</dc:creator>
      <dc:date>2023-02-10T10:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 months based on Year and Month Name selection</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3076907#M107013</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="469112" data-lia-user-login="amehrosh" class="lia-mention lia-mention-user"&gt;amehrosh&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please create measure with below dax formula:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR cur_year =
    SELECTEDVALUE ( 'Table 2'[Year] )
VAR cur_month =
    SELECTEDVALUE ( 'Table 3'[Month] )
VAR _month =
    SWITCH (
        cur_month,
        "Jan", 1,
        "Feb", 2,
        "Mar", 3,
        "Apr", 4,
        "May", 5,
        "Jun", 6,
        "Jul", 7,
        "Aug", 8,
        "Sep", 9,
        "Oct", 10,
        "Nov", 11,
        "Dec", 12
    )
VAR max_date =
    DATE ( cur_year, _month, 1 )
VAR tmp =
    DATESINPERIOD ( 'Table 4'[Date], max_date, -12, MONTH )
VAR cur_date =
    SELECTEDVALUE ( 'Table'[Date] )
RETURN
    IF ( cur_date IN tmp, 1 )
&lt;/LI-CODE&gt;
&lt;P&gt;Add a matrix visual and add this measure to filter pane and apply:&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;
&lt;P&gt;For more details, please refer the attached .pbix file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_Binbin Yu&lt;BR /&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 03:08:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-12-months-based-on-Year-and-Month-Name-selection/m-p/3076907#M107013</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-02-13T03:08:15Z</dc:date>
    </item>
  </channel>
</rss>

