<?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: The sameperoidlastyear function calculates the value for its year and not the previous year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4086326#M162191</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;You may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also this:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Year-Over-Year-Change/m-p/2886015#M909" target="_blank"&gt;(1) Better Year Over Year Change - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, this video demonstrates numerous different ways to calculate time intelligence measures:&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/nUZPk7lpe_Q" data-video-remote-vid="https://youtu.be/nUZPk7lpe_Q" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnUZPk7lpe_Q%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnUZPk7lpe_Q&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnUZPk7lpe_Q%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2024 08:42:10 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2024-08-07T08:42:10Z</dc:date>
    <item>
      <title>The sameperoidlastyear function calculates the value for its year and not the previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4086223#M162182</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm having trouble writing a measure that calculates last year's value. Below is an image showing what I mean:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I need the "Wolumen YA" measure to calculate growth in the current year relative to last year. For reasons I don't understand, the measure calculates the value for its year. Below is the measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wolumen YA = CALCULATE([Wolumen], SAMEPERIODLASTYEAR(Dates[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe someone has encountered a similar problem and will be able to explain what's wrong here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 07:58:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4086223#M162182</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-07T07:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: The sameperoidlastyear function calculates the value for its year and not the previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4086326#M162191</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;You may find this helpful - &lt;A href="https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also this:&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/Better-Year-Over-Year-Change/m-p/2886015#M909" target="_blank"&gt;(1) Better Year Over Year Change - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008" target="_blank"&gt;https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, this video demonstrates numerous different ways to calculate time intelligence measures:&lt;/P&gt;
&lt;P&gt;&lt;div data-video-id="https://youtu.be/nUZPk7lpe_Q" data-video-remote-vid="https://youtu.be/nUZPk7lpe_Q" class="lia-video-container lia-media-is-center lia-media-size-medium"&gt;&lt;iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnUZPk7lpe_Q%3Ffeature%3Doembed&amp;amp;display_name=YouTube&amp;amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnUZPk7lpe_Q&amp;amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnUZPk7lpe_Q%2Fhqdefault.jpg&amp;amp;type=text%2Fhtml&amp;amp;schema=youtube" allowfullscreen="" style="max-width: 100%"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 08:42:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4086326#M162191</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-08-07T08:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: The sameperoidlastyear function calculates the value for its year and not the previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4086606#M162204</link>
      <description>&lt;P&gt;What's in the matrix visual? Which tables are used in the model? What are the relationships?&lt;/P&gt;
&lt;P&gt;What is the measure &lt;STRONG&gt;[Wolumen]&lt;/STRONG&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 11:12:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4086606#M162204</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2024-08-07T11:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: The sameperoidlastyear function calculates the value for its year and not the previous year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4091206#M162369</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;Thanks for the reply from&amp;nbsp;Greg_Deckler&amp;nbsp;and&amp;nbsp;HotChilli&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, the following test is for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create several measures as follow&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;This year = SUM('Table'[Value])&lt;/LI-CODE&gt;
&lt;P&gt;The measure was created just to restore your scenario, as I don't know the creation logic of your Wolumen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _year = MAX([Year])
VAR _month = MAX([Month])
RETURN
CALCULATE([This year], FILTER(ALL('Table'), [Year] = _year - 1 &amp;amp;&amp;amp; [Month] = _month))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure 1 = SUMX(VALUES('Table'[Month]), [Measure])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last year = SUMX(VALUES('Table'[Year]), [Measure 1])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yulia Xu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 08:37:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-sameperoidlastyear-function-calculates-the-value-for-its/m-p/4091206#M162369</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-09T08:37:16Z</dc:date>
    </item>
  </channel>
</rss>

