<?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: If statement for greater date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2988342#M100425</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490391" data-lia-user-login="Rustynom" class="lia-mention lia-mention-user"&gt;Rustynom&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) This is my test data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(2) We can create a calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Needs Follow-up = var _maxdate=MAXX(FILTER('Follow-Ups',[User ID]=Responses[User ID]),[Follow-uo reply date])

 return IF(_maxdate&amp;gt;=[Latest Response Date],"Yes","No")&lt;/LI-CODE&gt;
&lt;P&gt;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Dec 2022 06:16:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-12-26T06:16:37Z</dc:date>
    <item>
      <title>If statement for greater date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2984925#M100133</link>
      <description>&lt;P&gt;I'm trying to create a "followed up" column in my response table which will return "yes" if a person with a matching user ID in the follow-ups table has a follow-up date greater than the latest response date. If no date exists in the follow-ups table or the date is prior to the latest response, the column should return "no".&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&gt;Right now I'm doing this with 2 columns; The first returns the latest follow-up reply date from the follow-ups table. The second column returns whether the latest follow-up is greater than the response date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;User's latest follow-up = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Follow-Ups'[Follow-up reply date]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Date] ), &lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;( 'Follow-Ups', 'Follow-Ups'[User ID] = 'Responses'[User ID] ) )&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Needs Follow-up? = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Responses'[User's latest follow-up]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&amp;lt;'Responses'[Latest Response Date]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Date],&lt;/SPAN&gt;&lt;SPAN&gt;"Yes"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"No"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to this and my approach works but seems inneficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 16:30:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2984925#M100133</guid>
      <dc:creator>Rustynom</dc:creator>
      <dc:date>2022-12-23T16:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: If statement for greater date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2985540#M100175</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490391" data-lia-user-login="Rustynom" class="lia-mention lia-mention-user"&gt;Rustynom&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to the &lt;A href="https://blogs.perficient.com/2022/12/20/calculated-column-vs-measures-in-power-bi-understand-the-difference/" target="_blank" rel="noopener"&gt;document&lt;/A&gt;, measures only consume memory during calculations and have better performance than computed columns. We recommend that you create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure_need = 
var _followdate=CALCULATE(MAX('Follow-Ups'[Follow-uo reply date]),FILTER('Follow-Ups','Follow-Ups'[User ID]=RELATED('Responses'[User ID])))
return 
IF(_followdate&amp;gt;SELECTEDVALUE('Responses'[Latest Response Date]),"Yes","No")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 02:34:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2985540#M100175</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-23T02:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: If statement for greater date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2987028#M100288</link>
      <description>&lt;P&gt;Thank you for the reply on this. I tried implementing your recommendation here, however I'm unable to structure the relationships in a way that will allow the RELATED('Responses'[User ID]) to be recognized by the measure.&lt;BR /&gt;I've also tinkered around with your attached file and below is the error I get when attempting to append additional data to both of the test datasets.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems the relationship cannot be structured as many to one if duplicates are contained within both data sets. Because we are measuring only the latest of a list follow-up replies against a list of many responses, both datasets will contain duplicate user IDs.&lt;BR /&gt;If there is some way of transforming the follow-up table’s duplicate User ID's to keep the rows with the latest follow-up reply date, that would probably let me implement your measure.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 18:52:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2987028#M100288</guid>
      <dc:creator>Rustynom</dc:creator>
      <dc:date>2022-12-23T18:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: If statement for greater date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2988342#M100425</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="490391" data-lia-user-login="Rustynom" class="lia-mention lia-mention-user"&gt;Rustynom&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) This is my test data.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(2) We can create a calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Needs Follow-up = var _maxdate=MAXX(FILTER('Follow-Ups',[User ID]=Responses[User ID]),[Follow-uo reply date])

 return IF(_maxdate&amp;gt;=[Latest Response Date],"Yes","No")&lt;/LI-CODE&gt;
&lt;P&gt;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 06:16:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2988342#M100425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-26T06:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: If statement for greater date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2993575#M100777</link>
      <description>&lt;P&gt;This worked! Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2022 15:13:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-statement-for-greater-date/m-p/2993575#M100777</guid>
      <dc:creator>Rustynom</dc:creator>
      <dc:date>2022-12-29T15:13:24Z</dc:date>
    </item>
  </channel>
</rss>

