<?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 Prior Date with Data in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548250#M72035</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to find the prior date with data as a measure,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two tables, 1 is a Calander table and 1 is a Lines table,&lt;/P&gt;&lt;P&gt;Column Date comes from Calander, column Volume (Measure) comes from Lines&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has to be measure only, I am connected to a data-set and cannot create a calculated column,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This doesn't work:&lt;BR /&gt;CALCULATE(CALCULATE(MAX(Lines[Date]), DATEADD(Dates[Date],-1,DAY)), FILTER(Lines, [Volume]&amp;gt;0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result needed:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any guidance is appreciated,&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;</description>
    <pubDate>Mon, 30 May 2022 16:56:13 GMT</pubDate>
    <dc:creator>YABOUSALEH</dc:creator>
    <dc:date>2022-05-30T16:56:13Z</dc:date>
    <item>
      <title>Prior Date with Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548250#M72035</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to find the prior date with data as a measure,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two tables, 1 is a Calander table and 1 is a Lines table,&lt;/P&gt;&lt;P&gt;Column Date comes from Calander, column Volume (Measure) comes from Lines&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has to be measure only, I am connected to a data-set and cannot create a calculated column,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This doesn't work:&lt;BR /&gt;CALCULATE(CALCULATE(MAX(Lines[Date]), DATEADD(Dates[Date],-1,DAY)), FILTER(Lines, [Volume]&amp;gt;0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result needed:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any guidance is appreciated,&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 16:56:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548250#M72035</guid>
      <dc:creator>YABOUSALEH</dc:creator>
      <dc:date>2022-05-30T16:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Prior Date with Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548294#M72039</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;actualdate&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;max&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Date'[Date]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;actualdate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Lines[Volume]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 17:18:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548294#M72039</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-30T17:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Prior Date with Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548324#M72042</link>
      <description>&lt;P&gt;I get an error:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 17:50:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548324#M72042</guid>
      <dc:creator>YABOUSALEH</dc:creator>
      <dc:date>2022-05-30T17:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Prior Date with Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548329#M72043</link>
      <description>&lt;P&gt;Please send me o copy of your measure&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 17:53:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548329#M72043</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-30T17:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Prior Date with Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548342#M72046</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="266080" data-lia-user-login="YABOUSALEH" class="lia-mention lia-mention-user"&gt;YABOUSALEH&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Prior Date with Volume =
MAXX (
    FILTER (
        ALLSELECTED ( Lines ),
        [Volume] &amp;gt; 0
            &amp;amp;&amp;amp; 'Date'[Date] &amp;lt; MAX ( 'Date'[Date] )
    ),
    'Date'[Date]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 02:11:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548342#M72046</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-31T02:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Prior Date with Data</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548448#M72049</link>
      <description>&lt;P&gt;This is great, almost perfect, thank you, slightly modified, used the calander table instead,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original:&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;Modified:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MAXX (
    FILTER (
        ALLSELECTED(Dates),
        [Volume] &amp;gt; 0
            &amp;amp;&amp;amp; Dates[Date] &amp;lt; MAX ( Dates[Date] )
    ),
    Dates[Date]
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&lt;U&gt;This might be nitpicking, any chance dates outside the filters would populate?&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Great if possible, can do without,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;PS. I confirmed your response as an answer, would you just modify the code to Dates (or Calander) instead of Lines, for consistency to the next person &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 30 May 2022 20:30:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Prior-Date-with-Data/m-p/2548448#M72049</guid>
      <dc:creator>YABOUSALEH</dc:creator>
      <dc:date>2022-05-30T20:30:11Z</dc:date>
    </item>
  </channel>
</rss>

