<?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: Calculate the difference between values of a column based on a number of rows in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-difference-between-values-of-a-column-based-on-a/m-p/1696145#M34892</link>
    <description>&lt;P&gt;Thank you Nandic, your code helped me to create a column with the number of cases as of 14 days before; I just created another column with the subtraction to get the difference in the number of cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pedro&lt;/P&gt;</description>
    <pubDate>Mon, 01 Mar 2021 13:30:36 GMT</pubDate>
    <dc:creator>pjporrino</dc:creator>
    <dc:date>2021-03-01T13:30:36Z</dc:date>
    <item>
      <title>Calculate the difference between values of a column based on a number of rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-difference-between-values-of-a-column-based-on-a/m-p/1693835#M34840</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd really appreciate you can help me. I have a table like this one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, it's showing the number of cases by day and country. The list has many rows. I need to add a column that shows the difference between the number of cases of that day and the number of cases 14 days before. I'm not familiar with DAX, and I know neither how to refer to the specific value of a cell in a column nor how to specify the number of rows behind to look for the difference's value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate any help you can provide.&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pedro&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 19:38:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-difference-between-values-of-a-column-based-on-a/m-p/1693835#M34840</guid>
      <dc:creator>pjporrino</dc:creator>
      <dc:date>2021-02-27T19:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the difference between values of a column based on a number of rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-difference-between-values-of-a-column-based-on-a/m-p/1693961#M34842</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;You can use LookupValue function:&lt;BR /&gt;&lt;BR /&gt;Country_Date&amp;nbsp;-&amp;nbsp;14&amp;nbsp;days&amp;nbsp;=&lt;BR /&gt;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;LOOKUPVALUE&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Covid[New_Cases],&lt;BR /&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Covid[Country],&amp;nbsp;Covid[Country],&lt;BR /&gt;&lt;SPAN class="indent4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Covid[Date],&amp;nbsp;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&amp;nbsp;(&lt;/SPAN&gt;&amp;nbsp;Covid[Date],&amp;nbsp;&lt;SPAN class="Number" style="color: #ee7f18;"&gt;-14&lt;/SPAN&gt;,&amp;nbsp;&lt;SPAN class="Keyword" style="color: #035aca;"&gt;DAY&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;This is result:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;Firstly it searches for same country and then for date and date - 14 days.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="Parenthesis" style="color: #808080;"&gt;Regards,&lt;BR /&gt;Nemanja Andic&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 23:34:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-difference-between-values-of-a-column-based-on-a/m-p/1693961#M34842</guid>
      <dc:creator>nandic</dc:creator>
      <dc:date>2021-02-27T23:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the difference between values of a column based on a number of rows</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-difference-between-values-of-a-column-based-on-a/m-p/1696145#M34892</link>
      <description>&lt;P&gt;Thank you Nandic, your code helped me to create a column with the number of cases as of 14 days before; I just created another column with the subtraction to get the difference in the number of cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pedro&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 13:30:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-difference-between-values-of-a-column-based-on-a/m-p/1696145#M34892</guid>
      <dc:creator>pjporrino</dc:creator>
      <dc:date>2021-03-01T13:30:36Z</dc:date>
    </item>
  </channel>
</rss>

