<?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: previous date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2704000#M81950</link>
    <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;thanks for your quick feedback.&lt;/P&gt;&lt;P&gt;I read your article, but I think that unless I'm mistaken it doesn't apply in my dataset.&lt;/P&gt;&lt;P&gt;If I'm not mistaken in your article you have two different columns for the dates, while in my case I have only one.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;what I try to do is only to transcribe the time of validation of the previous step :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;for validator 2, show me the time of validator 1&lt;/LI&gt;&lt;LI&gt;for validator 3, show me the time of validator 2&lt;/LI&gt;&lt;LI&gt;for validator 4, show me the time of validator 3&lt;/LI&gt;&lt;LI&gt;for validator 5, show me the time of validator 4&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Aug 2022 17:05:13 GMT</pubDate>
    <dc:creator>EDO_01_1789</dc:creator>
    <dc:date>2022-08-16T17:05:13Z</dc:date>
    <item>
      <title>previous date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2703953#M81943</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I would like to create a New column that will allow me to have the time of the previous validator.&lt;/P&gt;&lt;P&gt;here is the result I would like to have.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in my table there are between 5 and 4 validators (column with number 2) by Excel file (column with number 1).&lt;BR /&gt;What I want is that in the line of the validator 2, I can have the time (column with number 3) and the date of validation of the validator 1 of the same excel file).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I don't know if it's ideal to do it in M or in DAX ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;for your information:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;would it be possible not to modify the formatting (no unpivot or transpose transformation).&lt;/LI&gt;&lt;LI&gt;validator 1 has no pre-date since it is the creator.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I hope that my request has been well explained and that you could help me please&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 16:42:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2703953#M81943</guid>
      <dc:creator>EDO_01_1789</dc:creator>
      <dc:date>2022-08-16T16:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: previous date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2703972#M81944</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="381709" data-lia-user-login="EDO_01_1789" class="lia-mention lia-mention-user"&gt;EDO_01_1789&lt;/a&gt;&amp;nbsp;Basically MTBF.&amp;nbsp;See my article on Mean Time Between Failure (MTBF) which uses EARLIER: &lt;A href="http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586" target="_blank"&gt;http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586&lt;/A&gt;.&lt;BR /&gt;The basic pattern is:&lt;BR /&gt;Column =&amp;nbsp;&lt;BR /&gt;&amp;nbsp; VAR __Current = [Value]&lt;BR /&gt;&amp;nbsp; VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] &amp;lt; EARLIER('Table'[Date])),[Date])&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp; __Current - __Previous&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 16:48:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2703972#M81944</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-08-16T16:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: previous date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2704000#M81950</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;thanks for your quick feedback.&lt;/P&gt;&lt;P&gt;I read your article, but I think that unless I'm mistaken it doesn't apply in my dataset.&lt;/P&gt;&lt;P&gt;If I'm not mistaken in your article you have two different columns for the dates, while in my case I have only one.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;what I try to do is only to transcribe the time of validation of the previous step :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;for validator 2, show me the time of validator 1&lt;/LI&gt;&lt;LI&gt;for validator 3, show me the time of validator 2&lt;/LI&gt;&lt;LI&gt;for validator 4, show me the time of validator 3&lt;/LI&gt;&lt;LI&gt;for validator 5, show me the time of validator 4&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 17:05:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2704000#M81950</guid>
      <dc:creator>EDO_01_1789</dc:creator>
      <dc:date>2022-08-16T17:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: previous date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2704083#M81955</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="381709" data-lia-user-login="EDO_01_1789" class="lia-mention lia-mention-user"&gt;EDO_01_1789&lt;/a&gt;&amp;nbsp;Well, you would just stop at getting the __PreviousDate. All comes down to the filters you use, so something like:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
  VAR __Date = [Validator Date]
  VAR __FileLeafRef = [FileLeafRef]
  VAR __PreviousDate = 
    SWITCH('Table'[Attribute],
      "Validator 2 Comments",MAXX(FILTER('Table',[Date]&amp;lt;__Date &amp;amp;&amp;amp; [Attribute] = "Validator 1 comments" &amp;amp;&amp;amp; [File Leaf Ref] = __FileLeafRef,
      "Validator 3 Comments",MAXX(FILTER('Table',[Date]&amp;lt;__Date &amp;amp;&amp;amp; [Attribute] = "Validator 2 comments" &amp;amp;&amp;amp; [File Leaf Ref] = __FileLeafRef,
      "Validator 4 Comments",MAXX(FILTER('Table',[Date]&amp;lt;__Date &amp;amp;&amp;amp; [Attribute] = "Validator 3 comments" &amp;amp;&amp;amp; [File Leaf Ref] = __FileLeafRef,
      BLANK()
    )
RETURN
  __PreviousDate

&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Aug 2022 17:56:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2704083#M81955</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-08-16T17:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: previous date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2704217#M81965</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel embarrassed, sorry for the bother.&lt;/P&gt;&lt;P&gt;but what do you want me to add in this part of your formula.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have only one column that contains dates in my data table, called "Validator Date". I think you have already integrated it in the first variable of your formula (Var_date)&lt;/P&gt;&lt;P&gt;Can you help me?&lt;/P&gt;&lt;P&gt;moreover when i try to change this part by my famous column, i have this error message and i don't know why (is it missing a parenthesis or a comma somewhere)?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 19:17:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2704217#M81965</guid>
      <dc:creator>EDO_01_1789</dc:creator>
      <dc:date>2022-08-16T19:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: previous date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2737557#M83983</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="381709" data-lia-user-login="EDO_01_1789" class="lia-mention lia-mention-user"&gt;EDO_01_1789&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your description, I have created a simple sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;previous date = 
VAR _num =
    VALUE ( MID ( [Attribute], 11, FIND ( " :", [Attribute] ) - 11 ) )
VAR _attribute = "Validator " &amp;amp; _num - 1 &amp;amp; " : comments"
RETURN
    MAXX (
        FILTER (
            'Table',
            [FileLeafRef] = EARLIER ( 'Table'[FileLeafRef] )
                &amp;amp;&amp;amp; [Attribute] = _attribute
        ),
        [Validator Date]
    )
&lt;/LI-CODE&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 08:59:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/previous-date/m-p/2737557#M83983</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-08-31T08:59:26Z</dc:date>
    </item>
  </channel>
</rss>

