<?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: Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3782081#M147751</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have a solution where I do not need to create a seconde calendar table?&lt;/P&gt;</description>
    <pubDate>Thu, 21 Mar 2024 08:42:12 GMT</pubDate>
    <dc:creator>Bwendos_Den</dc:creator>
    <dc:date>2024-03-21T08:42:12Z</dc:date>
    <item>
      <title>Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273690#M55394</link>
      <description>&lt;P&gt;I would like to know if there is a way to display dynamically last 12 months data based on Year/Quarter/Month Selection&lt;/P&gt;&lt;P&gt;Tried Many ways but couldnt achieve with Date Hirearchy filter.&lt;/P&gt;&lt;P&gt;If user selects 2021 Q1 ..It should display last 12 months data with axis 2021.01 , 2021.02 , 2021.03 , 2020.12 , 2020.11 , 2020.10 etc&lt;/P&gt;&lt;P&gt;if user selects 2021 March ..It should display march data along with last 12 months data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be 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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 19:41:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273690#M55394</guid>
      <dc:creator>Tu-Learn</dc:creator>
      <dc:date>2022-01-08T19:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273707#M55395</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;There are multiple ways to do this. One of the more straightforward ways is to make a copy of your calendar table:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calendar for Visual = &lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Then create following relationship:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&lt;BR /&gt;Now create measure with following dax:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Last12MonthsFilter = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;NumOfMonths&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;12&lt;/SPAN&gt;&lt;/DIV&gt;&lt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;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CurVisCal&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;PreviousDates&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;USERELATIONSHIP&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar for Visual'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'Calendar'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Then apply that as a filter to your visual.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;End result:&lt;BR /&gt;&lt;/STRONG&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;The visual uses calendar[Date] and slicer calendar_for_visual[date]&lt;BR /&gt;&lt;BR /&gt;I hope this helps and if it does consider accepting this as a solution and giving the post a thumbs up!&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 08 Jan 2022 20:36:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273707#M55395</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-01-08T20:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273740#M55396</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I followed the same process as you said but the visual displaying whatever month i selected instead of last 12 months, not sure where i missed .&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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 21:23:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273740#M55396</guid>
      <dc:creator>Tu-Learn</dc:creator>
      <dc:date>2022-01-08T21:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273805#M55399</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Is your relationship M:1 and inactive with filter direction "single" like in my example? Another possible problem might be with the slicer visual. Are you using 'Calendar for visual' table as the slicer? At a glance your DAX seems to follow the same logic so the problem is with visual or relationships.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Jan 2022 23:57:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/2273805#M55399</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-01-08T23:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3088042#M108049</link>
      <description>&lt;P&gt;It was useful for me.&lt;BR /&gt;I thought about sharing this tutorial for anyone who would have the same issue but with other visuals where you don't want to activate the relationships between the two calendar tables in every single mesures and keep your dates fields from your main calendar table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=d8Rm7dwM6gc" target="_self"&gt;Show last 6 months based on user single slicer selection from SQLBI&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 13:35:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3088042#M108049</guid>
      <dc:creator>Chrisjr</dc:creator>
      <dc:date>2023-02-20T13:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3711145#M144393</link>
      <description>&lt;P&gt;This very interesting solution. However I would like to modify it a bit and maybe it will be easy for you support me. I follow you guidance and everything works perfect but I would like my Last12Month works only when no "Date" filter/slicer is applied. If user select on the slicer specific month or year ect. then the measure should show exact selected period (with no additional previous 12 months data). Is there a way that we can doi it?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 13:28:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3711145#M144393</guid>
      <dc:creator>kb83</dc:creator>
      <dc:date>2024-02-20T13:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3712489#M144446</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;Thank you for your reply. Actually I want my trend chart shows last 12 months as default chart view but if any Date filter is selected then the chart/measure should "reset" this 12 months period from the chart view and behave like a standard view that reacts on the slicer selection i.e if user selects "January" it should show January only and not January with previous 12 months...Hope this explanaition is clear now.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 23:44:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3712489#M144446</guid>
      <dc:creator>kb83</dc:creator>
      <dc:date>2024-02-20T23:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically display last 12 months in chart visual based on Date Slicer which is in Hirearchy model</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3782081#M147751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have a solution where I do not need to create a seconde calendar table?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 08:42:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamically-display-last-12-months-in-chart-visual-based-on-Date/m-p/3782081#M147751</guid>
      <dc:creator>Bwendos_Den</dc:creator>
      <dc:date>2024-03-21T08:42:12Z</dc:date>
    </item>
  </channel>
</rss>

