<?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: SAMEPERIODLASTYEAR with year and month filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-with-year-and-month-filters/m-p/1731949#M35897</link>
    <description>&lt;P&gt;&lt;EM&gt;Result last year = CALCULATE(SUM(Result[sum]),FILTER(all(Result),YEAR(Result[Date])=SELECTEDVALUE(Dates[Year]) -1 &amp;amp;&amp;amp; MONTH(Result[Dates])=SELECTEDVALUE(Date[Month])))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This did the trick, thank you so much!&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 06:49:54 GMT</pubDate>
    <dc:creator>Petsnell</dc:creator>
    <dc:date>2021-03-19T06:49:54Z</dc:date>
    <item>
      <title>SAMEPERIODLASTYEAR with year and month filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-with-year-and-month-filters/m-p/1730830#M35835</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;I&amp;nbsp;&lt;/SPAN&gt;have a measure for periodic results&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Result = CALCULATE(SUM(Result[sum]),FILTER(ALL(Datotabell),YEAR(Dates[Date])=SELECTEDVALUE(Dates[Year])),&lt;/P&gt;&lt;P&gt;FILTER(ALL(Date),MONTH(Date[Dates])=SELECTEDVALUE(Date[Month])))'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works just fine, and now I want to create a new table based on 'Result' with values from the same period last year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Result last year = CALCULATE(([Result]), SAMEPERIODLASTYEAR(Dates[Date]))'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This returns really large values that I can't really make sense of. Any suggestions?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 14:54:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-with-year-and-month-filters/m-p/1730830#M35835</guid>
      <dc:creator>Petsnell</dc:creator>
      <dc:date>2021-03-18T14:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR with year and month filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-with-year-and-month-filters/m-p/1730984#M35848</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291249" data-lia-user-login="Petsnell" class="lia-mention lia-mention-user"&gt;Petsnell&lt;/a&gt; , do not use the previous result. Ideally if date table is joined then you do not need those filters&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if date table is connected&lt;/P&gt;
&lt;P&gt;this should be the first measure&lt;/P&gt;
&lt;P&gt;Result = CALCULATE(SUM(Result[sum]))&lt;/P&gt;
&lt;P&gt;Then result last year will do like&lt;/P&gt;
&lt;P&gt;Result last year = CALCULATE(([Result]), SAMEPERIODLASTYEAR(Dates[Date]))'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;Result last year = CALCULATE(SUM(Result[sum]),FILTER(all(Result),YEAR(Result[Date])=SELECTEDVALUE(Dates[Year]) -1 &amp;amp;&amp;amp; MONTH(Result[Dates])=SELECTEDVALUE(Date[Month])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If date table is not connected&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First measure&lt;/P&gt;
&lt;P&gt;Result = CALCULATE(SUM(Result[sum]),FILTER((Result),YEAR(Result[Date])=SELECTEDVALUE(Dates[Year])),&lt;/P&gt;
&lt;P&gt;FILTER(ALL(Date),MONTH(Result[Dates])=SELECTEDVALUE(Date[Month])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;second measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result = CALCULATE(SUM(Result[sum]),FILTER((Result),YEAR(Result[Date])=SELECTEDVALUE(Dates[Year])),&lt;/P&gt;
&lt;P&gt;FILTER(ALL(Date),MONTH(Result[Dates])=SELECTEDVALUE(Date[Month])))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 16:02:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-with-year-and-month-filters/m-p/1730984#M35848</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-03-18T16:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAMEPERIODLASTYEAR with year and month filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-with-year-and-month-filters/m-p/1731949#M35897</link>
      <description>&lt;P&gt;&lt;EM&gt;Result last year = CALCULATE(SUM(Result[sum]),FILTER(all(Result),YEAR(Result[Date])=SELECTEDVALUE(Dates[Year]) -1 &amp;amp;&amp;amp; MONTH(Result[Dates])=SELECTEDVALUE(Date[Month])))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This did the trick, thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 06:49:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/SAMEPERIODLASTYEAR-with-year-and-month-filters/m-p/1731949#M35897</guid>
      <dc:creator>Petsnell</dc:creator>
      <dc:date>2021-03-19T06:49:54Z</dc:date>
    </item>
  </channel>
</rss>

