<?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 Show the last 3 years in report in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/2458989#M66451</link>
    <description>&lt;P&gt;I have similar problem but i'm not able to decide how to put your solution into it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want that when i click at the slicer of year (same as the one in the question) I should see the graphs as it is but along with that in the other visual i want to see only the past 3 years of sales/profit in number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please guide me. I did for the current year and&amp;nbsp; last year by using the SAMEASLASTYEAR formula, visualised on the card. However, i tried alot of things but failed to do for last 2 years or mainly N-1, N-2 and N-3 year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much in advance !&lt;/P&gt;</description>
    <pubDate>Fri, 15 Apr 2022 10:45:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-04-15T10:45:36Z</dc:date>
    <item>
      <title>how to Show the last 3 years in report</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238140#M20247</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am tring to get the last 3 years in my report. it look like i have in my report years 2020 , 2019, 2018, 2017,2016,2015&amp;nbsp;&lt;/P&gt;&lt;P&gt;i wnat to show onaly 2020,2019,2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also if the year change to 2021&lt;/P&gt;&lt;P&gt;it should update to&lt;/P&gt;&lt;P&gt;2021,2020,2019 and hide 2018, 2017,2016,2015&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you.&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 10:38:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238140#M20247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-21T10:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to Show the last 3 years in report</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238213#M20248</link>
      <description>I would suggest doing this filter in Power Query. See if this post can help &lt;A href="https://blog.crossjoin.co.uk/2018/01/08/in-the-previous-date-filters-in-power-bi-gettransform-power-query/" target="_blank"&gt;https://blog.crossjoin.co.uk/2018/01/08/in-the-previous-date-filters-in-power-bi-gettransform-power-query/&lt;/A&gt;</description>
      <pubDate>Tue, 21 Jul 2020 11:05:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238213#M20248</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2020-07-21T11:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to Show the last 3 years in report</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238218#M20251</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;You need to filter data in Power Query.&lt;BR /&gt;As&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="227497" data-lia-user-login="AllisonKennedy" class="lia-mention lia-mention-user"&gt;AllisonKennedy&lt;/a&gt;&amp;nbsp; mentioned, you can use built in functions to calculate last N months, years, days.&amp;nbsp;&lt;BR /&gt;But if you want to make sure it calculates years, where last 3 years are 2018, 2019, 2020 no matter which current month it is, here is approach:&lt;BR /&gt;1) create new column for year based on data in table:&amp;nbsp;Date.Year([Date])&lt;BR /&gt;2) create new column for current year:&amp;nbsp;Date.Year(DateTime.Date(DateTime.LocalNow()))&lt;BR /&gt;3) create new column to calculate difference between current year and year in data:&amp;nbsp;[Current Year]-[Year]&lt;/P&gt;&lt;P&gt;4) filter this colum to show only number 0,1,2 (it will filter only last 3 years)&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;/P&gt;&lt;P&gt;Nemanja&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 11:16:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238218#M20251</guid>
      <dc:creator>nandic</dc:creator>
      <dc:date>2020-07-21T11:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to Show the last 3 years in report</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238242#M20252</link>
      <description>Thanks &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="241317" data-lia-user-login="nandic" class="lia-mention lia-mention-user"&gt;nandic&lt;/a&gt;&lt;BR /&gt;Interesting approach! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;The built in date filters in Power Query behave the same regardless of current date, so when you filter for in the previous 1 years, it will give you all of 2019 right now. So to get 2018, 2019 and 2020 we can do an OR filter to get in the previous 2 years or in this year.&lt;BR /&gt;&lt;BR /&gt;The below code will work assuming you replace&lt;BR /&gt;#"Changed Type1" with the name of your last step&lt;BR /&gt;[OrderDate] with the name of the date column:&lt;BR /&gt;&lt;BR /&gt;= Table.SelectRows(#"Changed Type1", each Date.IsInPreviousNYears([OrderDate], 7) or Date.IsInCurrentYear([OrderDate]))&lt;BR /&gt;&lt;BR /&gt;Otherwise just click the arrow filter on the date column and choose 'in the previous' and add the OR condition to also be in this year.</description>
      <pubDate>Tue, 21 Jul 2020 11:29:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238242#M20252</guid>
      <dc:creator>AllisonKennedy</dc:creator>
      <dc:date>2020-07-21T11:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to Show the last 3 years in report</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238279#M20256</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt; , if the year is coming from date. Use relative date slice&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 11:45:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238279#M20256</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-07-21T11:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to Show the last 3 years in report</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238302#M20257</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="227497" data-lia-user-login="AllisonKennedy" class="lia-mention lia-mention-user"&gt;AllisonKennedy&lt;/a&gt;&amp;nbsp; for this time-saver &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;</description>
      <pubDate>Tue, 21 Jul 2020 11:52:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/1238302#M20257</guid>
      <dc:creator>nandic</dc:creator>
      <dc:date>2020-07-21T11:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to Show the last 3 years in report</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/2458989#M66451</link>
      <description>&lt;P&gt;I have similar problem but i'm not able to decide how to put your solution into it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want that when i click at the slicer of year (same as the one in the question) I should see the graphs as it is but along with that in the other visual i want to see only the past 3 years of sales/profit in number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please guide me. I did for the current year and&amp;nbsp; last year by using the SAMEASLASTYEAR formula, visualised on the card. However, i tried alot of things but failed to do for last 2 years or mainly N-1, N-2 and N-3 year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much in advance !&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2022 10:45:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-Show-the-last-3-years-in-report/m-p/2458989#M66451</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-15T10:45:36Z</dc:date>
    </item>
  </channel>
</rss>

