<?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 Last year with year as number in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4199038#M166639</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Got a table with year in number format,items and amounts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2020 | item01 | 10000 €&lt;/P&gt;&lt;P&gt;2020 | item02 | 3244 €&lt;/P&gt;&lt;P&gt;2021 | item 01 | 2312 €&lt;/P&gt;&lt;P&gt;2021 | item 02 | 6435 €&lt;/P&gt;&lt;P&gt;2022 | item 01 | 4334 €&lt;/P&gt;&lt;P&gt;2022 | item 02 | 5634 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A measure = sum(table[amount])&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A filter on the year = 2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure show : 9968 in a smart card&lt;/P&gt;&lt;P&gt;I'd like to show in another smart card the 2021 amount ( 8747) by calculating something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calculate [measure], [year]-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2024 08:14:27 GMT</pubDate>
    <dc:creator>Jay20024</dc:creator>
    <dc:date>2024-09-30T08:14:27Z</dc:date>
    <item>
      <title>Last year with year as number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4199038#M166639</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Got a table with year in number format,items and amounts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2020 | item01 | 10000 €&lt;/P&gt;&lt;P&gt;2020 | item02 | 3244 €&lt;/P&gt;&lt;P&gt;2021 | item 01 | 2312 €&lt;/P&gt;&lt;P&gt;2021 | item 02 | 6435 €&lt;/P&gt;&lt;P&gt;2022 | item 01 | 4334 €&lt;/P&gt;&lt;P&gt;2022 | item 02 | 5634 €&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A measure = sum(table[amount])&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A filter on the year = 2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure show : 9968 in a smart card&lt;/P&gt;&lt;P&gt;I'd like to show in another smart card the 2021 amount ( 8747) by calculating something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calculate [measure], [year]-1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 08:14:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4199038#M166639</guid>
      <dc:creator>Jay20024</dc:creator>
      <dc:date>2024-09-30T08:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Last year with year as number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4199548#M166657</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="816034" data-lia-user-login="Jay20024" class="lia-mention lia-mention-user"&gt;Jay20024&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;You have a few options here. You could add a filter on the visual in the filter pane as well. Here you can even do relative filters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could use a measure like this:&lt;/P&gt;
&lt;PRE&gt;Measure 2021 = CALCULATE([Measure], 'Table'[Year] = 2021)&lt;/PRE&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;Let me know if this helps &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;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 09:12:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4199548#M166657</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2024-09-30T09:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Last year with year as number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4199916#M166661</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="816034" data-lia-user-login="Jay20024" class="lia-mention lia-mention-user"&gt;Jay20024&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Try this below formula for dynamic approach&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PY = 
CALCULATE(
    [Sum Value],
    FILTER(
        ALL( Source[Year] ),
        Source[Year] = MAX( Source[Year] ) -1
    ) )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;screenshot attached&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;sanalytics&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 10:24:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4199916#M166661</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2024-09-30T10:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Last year with year as number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4200209#M166663</link>
      <description>&lt;P&gt;I need a get the result for each year to display them in a pivot table like that&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I can add them to a scorecard, make calculations. I need a behavior like previousyear&lt;/P&gt;&lt;P&gt;So each time a select a year in the filter, I get the line related to the selected year, total amount and total amount LY. Many thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 11:49:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4200209#M166663</guid>
      <dc:creator>Jay20024</dc:creator>
      <dc:date>2024-09-30T11:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Last year with year as number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4200308#M166666</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="816034" data-lia-user-login="Jay20024" class="lia-mention lia-mention-user"&gt;Jay20024&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I suggest you to replicate above all things in power bi and check. it seems that you have not tried or you have not understood the code.&lt;BR /&gt;MAX is respecting the filter context which is coming from your slicer as well.&lt;BR /&gt;Check from your end once.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;sanalytics&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 11:28:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4200308#M166666</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2024-09-30T11:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Last year with year as number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4200338#M166667</link>
      <description>&lt;P&gt;For the year i need to take in account the sected value of the filter. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 11:38:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4200338#M166667</guid>
      <dc:creator>Jay20024</dc:creator>
      <dc:date>2024-09-30T11:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Last year with year as number</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4200421#M166668</link>
      <description>&lt;P&gt;Indeed, There was a error. It works nice !&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 11:56:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Last-year-with-year-as-number/m-p/4200421#M166668</guid>
      <dc:creator>Jay20024</dc:creator>
      <dc:date>2024-09-30T11:56:06Z</dc:date>
    </item>
  </channel>
</rss>

