<?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 Calculate difference between two rows in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-two-rows/m-p/56049#M17</link>
    <description>&lt;P&gt;Hi. I am a beginner in Power BI; I do not know if this is the right forum.&lt;/P&gt;&lt;P&gt;I have the following table:&lt;/P&gt;&lt;P&gt;Year / Week&amp;nbsp;/ Value&lt;/P&gt;&lt;P&gt;2015 / 27 / 1000&lt;/P&gt;&lt;P&gt;2015 / 28 / 1010&lt;/P&gt;&lt;P&gt;2016 / 27 / 1200&lt;/P&gt;&lt;P&gt;2016 / 28 / 1205&lt;/P&gt;&lt;P&gt;I need to plot the value growth for each week YoY, ie 1200/1000 = 120% for the week 27 (YoY) and 1205/1010 = 119.3% for the week 28 (YoY)&lt;/P&gt;&lt;P&gt;I tried to do this by creating a column and a measure, but can not find the way.&lt;/P&gt;&lt;P&gt;The year and week, are values and no dates.&lt;/P&gt;&lt;P&gt;Some help?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2016 15:30:44 GMT</pubDate>
    <dc:creator>csanromano</dc:creator>
    <dc:date>2016-08-05T15:30:44Z</dc:date>
    <item>
      <title>Calculate difference between two rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-two-rows/m-p/56049#M17</link>
      <description>&lt;P&gt;Hi. I am a beginner in Power BI; I do not know if this is the right forum.&lt;/P&gt;&lt;P&gt;I have the following table:&lt;/P&gt;&lt;P&gt;Year / Week&amp;nbsp;/ Value&lt;/P&gt;&lt;P&gt;2015 / 27 / 1000&lt;/P&gt;&lt;P&gt;2015 / 28 / 1010&lt;/P&gt;&lt;P&gt;2016 / 27 / 1200&lt;/P&gt;&lt;P&gt;2016 / 28 / 1205&lt;/P&gt;&lt;P&gt;I need to plot the value growth for each week YoY, ie 1200/1000 = 120% for the week 27 (YoY) and 1205/1010 = 119.3% for the week 28 (YoY)&lt;/P&gt;&lt;P&gt;I tried to do this by creating a column and a measure, but can not find the way.&lt;/P&gt;&lt;P&gt;The year and week, are values and no dates.&lt;/P&gt;&lt;P&gt;Some help?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 15:30:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-two-rows/m-p/56049#M17</guid>
      <dc:creator>csanromano</dc:creator>
      <dc:date>2016-08-05T15:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate difference between two rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-two-rows/m-p/724901#M1499</link>
      <description>&lt;P&gt;Hi, I just worked on your problem.. If this is column of two years then the below calculation will work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DIVIDE(CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year]))),(CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])-1))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I build this formula in two sections&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Numerator:&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Denominator:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(SUM(Table1[Value]),FILTER('Table1','Table1'[Year]=MAX('Table1'[Year])-1))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;then did the divide.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Below are the results:: Let me know if it works for you :)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 26 Jun 2019 12:11:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-difference-between-two-rows/m-p/724901#M1499</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-26T12:11:30Z</dc:date>
    </item>
  </channel>
</rss>

