<?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: Use of Previous Date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738844#M2182</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response and guidance.&amp;nbsp;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the screenshot, we can see that the dax funcion gives me the previous date. I want to do that calculation directly in the left table, so I can calculate the value for the previous date of a given one. Right now, my solution uses the right table. If what I want is possible, I should be able to creat another colum in the left table with the value of the previous date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2019 15:06:11 GMT</pubDate>
    <dc:creator>rafaelcostatl</dc:creator>
    <dc:date>2019-07-12T15:06:11Z</dc:date>
    <item>
      <title>Use of Previous Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/734109#M1903</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a DAX that gives me the previous date of a given base date and it works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://social.msdn.microsoft.com/Forums/sqlserver/en-US/717ee0bf-5fbb-4731-a198-7a27f8937bab/dax-measure-to-find-date-of-previous-record-for-each-piece-of-data-in-a-time-series-help?forum=sqlkjpowerpivotforexcel" target="_blank"&gt;https://social.msdn.microsoft.com/Forums/sqlserver/en-US/717ee0bf-5fbb-4731-a198-7a27f8937bab/dax-measure-to-find-date-of-previous-record-for-each-piece-of-data-in-a-time-series-help?forum=sqlkjpowerpivotforexcel&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is already an improvemente to my&amp;nbsp; solution, which basically loads again a table with "date - 1 " as previous date to get the comparison going. Improvement because now the previous date ajusts to "wholes" (months when I have null values of a give measure). My decrementing solution would always look at the previous date, no matter if zero or null or whatever.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, what I want is a dax that calculates the previous measure for me, letting me go from my original solution completely, with a more beautifull and optimized solution:&lt;/P&gt;&lt;P&gt;I tried:&amp;nbsp;&lt;/P&gt;&lt;P&gt;//CODE START&lt;/P&gt;&lt;P&gt;PREV_CALC_MEASURE=&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;SPAN&gt;(SUMX('TABLE';'TABLE'[VALUE]));&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(ALL(&lt;SPAN&gt;'TABLE';'TABLE'[VALUE])&lt;/SPAN&gt;;&lt;SPAN&gt;'TABLE';'TABLE'[VALUE])&lt;/SPAN&gt;=&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//THE LINE BELLOW IS THE DAX THAT GIVES ME THE PREVIOUS DATE&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(MAX(Fact[Date]),FILTER(Fact,Fact[Date]&amp;lt;EARLIER(Fact[Date])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// END OF CODE&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;My solution with the double load of a table with the dax previous code already works as I need. I just want this code to get more classy :D&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Similar to which we can do in qlik "set analysis",&amp;nbsp; I am trying to calculate with a date restriction. The code that gives me the previous date works, so it is some mistake of mine that is preventing me from getting the desired result.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Anyway, I hope this&amp;nbsp; helps other people too.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you already,&lt;/DIV&gt;&lt;DIV&gt;Best Regards&lt;/DIV&gt;&lt;DIV&gt;Rafael&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 08 Jul 2019 12:38:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/734109#M1903</guid>
      <dc:creator>rafaelcostatl</dc:creator>
      <dc:date>2019-07-08T12:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Previous Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738503#M2157</link>
      <description>&lt;P&gt;Hi, can you add sample tables from your model with anonymised data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As described here:&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="How to Get Your Question Answered Quickly" uid="38490" url="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/m-p/38490#U38490"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 08:09:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738503#M2157</guid>
      <dc:creator>Stachu</dc:creator>
      <dc:date>2019-07-12T08:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Previous Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738844#M2182</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your response and guidance.&amp;nbsp;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In the screenshot, we can see that the dax funcion gives me the previous date. I want to do that calculation directly in the left table, so I can calculate the value for the previous date of a given one. Right now, my solution uses the right table. If what I want is possible, I should be able to creat another colum in the left table with the value of the previous date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 15:06:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738844#M2182</guid>
      <dc:creator>rafaelcostatl</dc:creator>
      <dc:date>2019-07-12T15:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Previous Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738878#M2184</link>
      <description>&lt;P&gt;can you show the source tables, preferably in the format that can be copied into PowerBI, rather than output tables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;also I don't really get the date format used, e.g.&lt;/P&gt;
&lt;P&gt;20140101.01&lt;/P&gt;
&lt;P&gt;20140101.05&lt;/P&gt;
&lt;P&gt;is it 1st Jan 2014? What's the meaning of .01/.05 after the date itself? Does the column have the date type or just a number type?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 15:28:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738878#M2184</guid>
      <dc:creator>Stachu</dc:creator>
      <dc:date>2019-07-12T15:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Use of Previous Date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738940#M2186</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought the name would make it self explanatory. Sorry. It is date_code because 201401 is january of 2014. The code attached to it is a random code (201401&lt;STRONG&gt;01.01&lt;/STRONG&gt;). The idea remains the same (the code does not change anything). I put it all this way to make it quickly. I will extract the tables and post it here then :)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;&lt;A href="https://drive.google.com/drive/folders/1IXR1rnwX4XEGx_wXOrWYXC2zCEhdOdTJ?usp=sharing" target="_blank"&gt;https://drive.google.com/drive/folders/1IXR1rnwX4XEGx_wXOrWYXC2zCEhdOdTJ?usp=sharing&lt;/A&gt;&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thx again&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 16:34:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Use-of-Previous-Date/m-p/738940#M2186</guid>
      <dc:creator>rafaelcostatl</dc:creator>
      <dc:date>2019-07-12T16:34:35Z</dc:date>
    </item>
  </channel>
</rss>

