<?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 Meassure that gets previous year values in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4109140#M163062</link>
    <description>&lt;P&gt;Hi there all&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have this meassure ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PrevPeriodSammensat = 
    CALCULATE(
        ROUND(SUMX(MergedInvoices, MergedInvoices[Beløb Uden moms]),2),
        FILTER(
            ALL('Date'), 
            'Date'[Year Number] = SELECTEDVALUE('Date'[Year Number])-1 &amp;amp;&amp;amp;
            WEEKNUM('Date'[Date]) &amp;gt;= MIN('Date'[Weeknumber]) &amp;amp;&amp;amp;
            WEEKNUM('Date'[Date]) &amp;lt;= MAX('Date'[Weeknumber])
        )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but for some reason it doesn't include the 31/12 (int his case 2021) ..&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;are there anyone who has an idea why this is ?&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2024 12:24:47 GMT</pubDate>
    <dc:creator>truttafisker</dc:creator>
    <dc:date>2024-08-20T12:24:47Z</dc:date>
    <item>
      <title>Meassure that gets previous year values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4109140#M163062</link>
      <description>&lt;P&gt;Hi there all&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have this meassure ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;PrevPeriodSammensat = 
    CALCULATE(
        ROUND(SUMX(MergedInvoices, MergedInvoices[Beløb Uden moms]),2),
        FILTER(
            ALL('Date'), 
            'Date'[Year Number] = SELECTEDVALUE('Date'[Year Number])-1 &amp;amp;&amp;amp;
            WEEKNUM('Date'[Date]) &amp;gt;= MIN('Date'[Weeknumber]) &amp;amp;&amp;amp;
            WEEKNUM('Date'[Date]) &amp;lt;= MAX('Date'[Weeknumber])
        )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but for some reason it doesn't include the 31/12 (int his case 2021) ..&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;are there anyone who has an idea why this is ?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 12:24:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4109140#M163062</guid>
      <dc:creator>truttafisker</dc:creator>
      <dc:date>2024-08-20T12:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Meassure that gets previous year values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4109236#M163067</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The&amp;nbsp;Weeknum&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;function can sometimes cause unexpected results around year boundaries.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Try this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PrevPeriodSammensat = &lt;BR /&gt;CALCULATE(&lt;BR /&gt;ROUND(SUMX(MergedInvoices, MergedInvoices[Beløb Uden moms]), 2),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Date'), &lt;BR /&gt;'Date'[Year Number] = SELECTEDVALUE('Date'[Year Number]) - 1 &amp;amp;&amp;amp;&lt;BR /&gt;(&lt;BR /&gt;('Date'[Weeknumber] &amp;gt;= MIN('Date'[Weeknumber]) &amp;amp;&amp;amp; 'Date'[Weeknumber] &amp;lt;= 52) ||&lt;BR /&gt;('Date'[Weeknumber] &amp;lt;= MAX('Date'[Weeknumber]) &amp;amp;&amp;amp; 'Date'[Weeknumber] &amp;gt;= 1)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 13:27:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4109236#M163067</guid>
      <dc:creator>Kaviraj11</dc:creator>
      <dc:date>2024-08-20T13:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Meassure that gets previous year values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4110620#M163136</link>
      <description>&lt;P&gt;hi there..&lt;BR /&gt;Thx for the possible solution .. and it actually seems to work .. but before i accept it as solution, why the OR operator and not AND ..&amp;nbsp;&lt;BR /&gt;And why 52 weeks instead of 53 ??&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 07:09:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4110620#M163136</guid>
      <dc:creator>truttafisker</dc:creator>
      <dc:date>2024-08-21T07:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Meassure that gets previous year values</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4111192#M163156</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your measure, you want to include dates that fall within the same week range but in the previous year. Using&lt;SPAN&gt;&amp;nbsp;'AND'&amp;nbsp;&lt;/SPAN&gt;would require both conditions to be true simultaneously, which isn’t possible for week numbers that span across the end of the year. By using&lt;SPAN&gt;&amp;nbsp;'OR'&lt;/SPAN&gt;, you ensure that either condition can be true, allowing you to capture the correct range of dates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason for not using week 53 is that not every year has a 53rd week. The ISO week date system, which is commonly used, only includes a 53rd week if the year starts on a Thursday or is a leap year starting on a Wednesday. Including week 53 could lead to inconsistencies or errors in years that only have 52 weeks.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 12:26:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Meassure-that-gets-previous-year-values/m-p/4111192#M163156</guid>
      <dc:creator>Kaviraj11</dc:creator>
      <dc:date>2024-08-21T12:26:08Z</dc:date>
    </item>
  </channel>
</rss>

