<?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: how to show blank for earlier dates and true data for the latest date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1686153#M34643</link>
    <description>&lt;P&gt;Thank you for the suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculated column created by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;was simpler and it fits to my needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway I didn't think about the fact that I'm mixing string and date in the same column, good point.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2021 09:43:48 GMT</pubDate>
    <dc:creator>marinalalves77</dc:creator>
    <dc:date>2021-02-24T09:43:48Z</dc:date>
    <item>
      <title>how to show blank for earlier dates and true data for the latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1683573#M34579</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a spreadsheet that contains a list of emails and the dates when I sent an email to these people. In another database I have the date when those users finally joined my application after receiving one or more emails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with the following behavior:&lt;/P&gt;&lt;P&gt;Table1&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Email&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Sent at&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a@a.com&lt;/TD&gt;&lt;TD&gt;14/06/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a@a.com&lt;/TD&gt;&lt;TD&gt;20/11/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b@b.com&lt;/TD&gt;&lt;TD&gt;20/11/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c@c.com&lt;/TD&gt;&lt;TD&gt;20/11/2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And another table with the following:&lt;/P&gt;&lt;P&gt;Table2&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Email&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;JoinedOn&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a@a.com&lt;/TD&gt;&lt;TD&gt;30/11/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b@b.com&lt;/TD&gt;&lt;TD&gt;30/11/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c@c.com&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to show is a table with all the times one user received an email, but I want only the latest email date to be shown withe the final date of join - the previous dates should appear as "ko", meaning that this first emails was not the responsible for making this user to join my application. Something like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Email&lt;/TD&gt;&lt;TD&gt;Sent at&lt;/TD&gt;&lt;TD&gt;Result of JoinedOn&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a@a.com&lt;/TD&gt;&lt;TD&gt;14/06/2020&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;KO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;a@a.com&lt;/TD&gt;&lt;TD&gt;20/11/2020&lt;/TD&gt;&lt;TD&gt;30/11/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;b@b.com&lt;/TD&gt;&lt;TD&gt;20/11/2020&lt;/TD&gt;&lt;TD&gt;30/11/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c@c.com&lt;/TD&gt;&lt;TD&gt;20/11/2020&lt;/TD&gt;&lt;TD&gt;KO&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every query I come up with always shows me the result of JoinedOn in every row.&lt;/P&gt;&lt;P&gt;Do you have any ideas on how to write it properly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 12:09:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1683573#M34579</guid>
      <dc:creator>marinalalves77</dc:creator>
      <dc:date>2021-02-23T12:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to show blank for earlier dates and true data for the latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1683671#M34583</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="286862" data-lia-user-login="marinalalves77" class="lia-mention lia-mention-user"&gt;marinalalves77&lt;/a&gt; , Create a new column in table 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;new column = &lt;BR /&gt;var _1 = maxx(filter(Table1,[Email] = earlier([Email])),[Sent at])&lt;BR /&gt;return &lt;BR /&gt;maxx(filter(Table2,Table2[Email] = Table1[Email] &amp;amp;&amp;amp; Table1[Send at] =_1), Table2[Joined On])&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 12:58:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1683671#M34583</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-02-23T12:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to show blank for earlier dates and true data for the latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1684198#M34599</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="286862" data-lia-user-login="marinalalves77" class="lia-mention lia-mention-user"&gt;marinalalves77&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your final table is not what there should be. You are mixing different data types in one column. Namely, in "Result of JoinedOn" you are mixing dates and strings. This will not work. Of course, you could turn everything into text but if you try to perform any calculations on the column the DAX will be awkward and more complex than needed. Not to say it'll be slow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you really must do it like that in DAX, then this will work. But due to how NATURALOUTERJOIN works, the syntax is a bit awkward since one has to get rid of data lineage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Final Table = // calculated table
var EmailsWithLatestDates =
    ADDCOLUMNS(
        DISTINCT( Table1[Email] ),
        "Sent at",
            var email = Table1[Email]
            // [Sent at] field must be of datetime type
            var LatestDate =
            MAXX(
                FILTER(
                    Table1,
                    Table1[Email] = email
                ),
                Table1[Sent at]
            )
            RETURN 
                LatestDate
    )
var EmailsWithJoinedOn =
    NATURALLEFTOUTERJOIN(
        SELECTCOLUMNS(
            EmailsWithLatestDates,
            "Email", Table1[Email] &amp;amp; "",
            "Sent at", [Sent at]
        ),
        SELECTCOLUMNS(
            Table2,
            "Email", Table2[Email] &amp;amp; "",
            "JoinedOn", FORMAT( Table2[JoinedOn], "dd/MM/YYYY" )
        )
    )
var AllTogether =
    SELECTCOLUMNS(
        NATURALLEFTOUTERJOIN(
            SELECTCOLUMNS(
                Table1,
                "Email", Table1[Email] &amp;amp; "",
                "Sent at", Table1[Sent at] + 0
            ),
            EmailsWithJoinedOn
        ),
        "Email",
            [Email],
        "Sent at",
            [Sent at],
        "Result of JoinedOn",
            If( [JoinedOn] = BLANK(), "KO", [JoinedOn] )
    )
return
    AllTogether&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 16:39:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1684198#M34599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-23T16:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to show blank for earlier dates and true data for the latest date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1686153#M34643</link>
      <description>&lt;P&gt;Thank you for the suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The calculated column created by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;was simpler and it fits to my needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway I didn't think about the fact that I'm mixing string and date in the same column, good point.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 09:43:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/how-to-show-blank-for-earlier-dates-and-true-data-for-the-latest/m-p/1686153#M34643</guid>
      <dc:creator>marinalalves77</dc:creator>
      <dc:date>2021-02-24T09:43:48Z</dc:date>
    </item>
  </channel>
</rss>

