<?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: DAX formula for staff member associated with most recent visit date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2691539#M81071</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128628" data-lia-user-login="PBInewbie17" class="lia-mention lia-mention-user"&gt;PBInewbie17&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;the most recent visit Staff =
VAR _a =
    DATEDIFF (
        IF (
            ISBLANK ( [Appraiser Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Appraiser Visit Date]
        ),
        IF (
            ISBLANK ( [Construction Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Construction Visit Date]
        ),
        DAY
    )
VAR _b =
    DATEDIFF (
        IF (
            ISBLANK ( [Construction Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Construction Visit Date]
        ),
        IF (
            ISBLANK ( [Underwriter Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Underwriter Visit Date]
        ),
        DAY
    )
VAR _c =
    DATEDIFF (
        IF (
            ISBLANK ( [Appraiser Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Appraiser Visit Date]
        ),
        IF (
            ISBLANK ( [Underwriter Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Underwriter Visit Date]
        ),
        DAY
    )
VAR _d =
    IF (
        _a &amp;lt;= 0,
        IF ( _c &amp;lt;= 0, [Appraiser Visit Staff], [Underwriter Visit Staff] ),
        IF ( _b &amp;lt;= 0, [Construction Visit Staff], [Underwriter Visit Staff] )
    )
RETURN
    IF (
        [Appraiser Visit Staff] = BLANK (),
        SWITCH (
            TRUE (),
            [Appraiser Visit Staff] = BLANK ()
                &amp;amp;&amp;amp; [Underwriter Visit Staff] = BLANK (), [Construction Visit Staff],
            [Appraiser Visit Staff] = BLANK ()
                &amp;amp;&amp;amp; [Underwriter Visit Staff] = BLANK (), [Construction Visit Staff],
            [Construction Visit Staff] = BLANK ()
                &amp;amp;&amp;amp; [Underwriter Visit Staff] = BLANK (), [Appraiser Visit Staff]
        ),
        _d
    )&lt;/LI-CODE&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Bubble&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2022 06:36:42 GMT</pubDate>
    <dc:creator>Bubble4502</dc:creator>
    <dc:date>2022-08-10T06:36:42Z</dc:date>
    <item>
      <title>DAX formula for staff member associated with most recent visit date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2679833#M80224</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m trying to determine what DAX formula would be used to create a new column that calculates the staff member associated with the most recent visit date. There are 6 total columns: 3 for each position's visit date and 3 with the associated position's staff member.&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;&lt;P&gt;Appraiser Visit Date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Appraiser Visit Staff&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Construction Visit Date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Construction Visit Staff&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Underwriter Visit Date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Underwriter Visit Staff&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;7/22/2022&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Tom Jones&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;7/22/2022&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Tom Jones&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;7/22/2022&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Tom Jones&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Peter Parker&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12/3/2020&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Jane Smith&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Kyle Le&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;8/2/2017&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Kyle Le&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4/11/2021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Hugo Jones&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4/11/2021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Hugo Jones&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;6/7/2018&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Johnny Appleseed&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;10/9/2019&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Parker Collins&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here’s where it gets tricky:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Some rows are completely blank. For those rows, I would like it to calculate a blank.&lt;/LI&gt;&lt;LI&gt;Several rows have the exact same visit dates and staff members listed.&lt;/LI&gt;&lt;LI&gt;There may be a staff member listed, but no associated date. For these items, I still want to pull the staff member’s name.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I appreciate any guidance.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2022 20:26:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2679833#M80224</guid>
      <dc:creator>PBInewbie17</dc:creator>
      <dc:date>2022-08-03T20:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula for staff member associated with most recent visit date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2680184#M80238</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128628" data-lia-user-login="PBInewbie17" class="lia-mention lia-mention-user"&gt;PBInewbie17&lt;/a&gt;.&amp;nbsp; Your data model is wrong.&amp;nbsp; What you want to have is a big list of visit types, dates and who was associated with that particular visit.&amp;nbsp; If you correct your data model, this isn't very difficult.&amp;nbsp; But with how your data is laid out, it's a nightmare to solve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Reformat your data model so that tables are long but narrow, not wide.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 00:35:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2680184#M80238</guid>
      <dc:creator>littlemojopuppy</dc:creator>
      <dc:date>2022-08-04T00:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula for staff member associated with most recent visit date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2689129#M80905</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128628" data-lia-user-login="PBInewbie17" class="lia-mention lia-mention-user"&gt;PBInewbie17&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;the most recent visit date =
VAR _a =
    DATEDIFF (
        IF (
            ISBLANK ( [Appraiser Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Appraiser Visit Date]
        ),
        IF (
            ISBLANK ( [Construction Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Construction Visit Date]
        ),
        DAY
    )
VAR _b =
    DATEDIFF (
        IF (
            ISBLANK ( [Construction Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Construction Visit Date]
        ),
        IF (
            ISBLANK ( [Underwriter Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Underwriter Visit Date]
        ),
        DAY
    )
VAR _c =
    DATEDIFF (
        IF (
            ISBLANK ( [Appraiser Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Appraiser Visit Date]
        ),
        IF (
            ISBLANK ( [Underwriter Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Underwriter Visit Date]
        ),
        DAY
    )
VAR _d =
    IF (
        _a &amp;lt;= 0,
        IF ( _c &amp;lt;= 0, [Appraiser Visit Date], [Underwriter Visit Date] ),
        IF ( _b &amp;lt;= 0, [Construction Visit Date], [Underwriter Visit Date] )
    )
RETURN
    IF ( _d = DATE ( 1899, 12, 31 ), BLANK (), _d )&lt;/LI-CODE&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Bubble&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 08:17:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2689129#M80905</guid>
      <dc:creator>Bubble4502</dc:creator>
      <dc:date>2022-08-09T08:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula for staff member associated with most recent visit date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2690628#M81001</link>
      <description>&lt;P&gt;Thank you, this helps. Once I find the most recent visit date, how do I calculate the corresponding staff person with that visit date?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 16:44:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2690628#M81001</guid>
      <dc:creator>PBInewbie17</dc:creator>
      <dc:date>2022-08-09T16:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula for staff member associated with most recent visit date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2691539#M81071</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128628" data-lia-user-login="PBInewbie17" class="lia-mention lia-mention-user"&gt;PBInewbie17&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;the most recent visit Staff =
VAR _a =
    DATEDIFF (
        IF (
            ISBLANK ( [Appraiser Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Appraiser Visit Date]
        ),
        IF (
            ISBLANK ( [Construction Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Construction Visit Date]
        ),
        DAY
    )
VAR _b =
    DATEDIFF (
        IF (
            ISBLANK ( [Construction Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Construction Visit Date]
        ),
        IF (
            ISBLANK ( [Underwriter Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Underwriter Visit Date]
        ),
        DAY
    )
VAR _c =
    DATEDIFF (
        IF (
            ISBLANK ( [Appraiser Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Appraiser Visit Date]
        ),
        IF (
            ISBLANK ( [Underwriter Visit Date] ),
            DATE ( 1899, 12, 31 ),
            [Underwriter Visit Date]
        ),
        DAY
    )
VAR _d =
    IF (
        _a &amp;lt;= 0,
        IF ( _c &amp;lt;= 0, [Appraiser Visit Staff], [Underwriter Visit Staff] ),
        IF ( _b &amp;lt;= 0, [Construction Visit Staff], [Underwriter Visit Staff] )
    )
RETURN
    IF (
        [Appraiser Visit Staff] = BLANK (),
        SWITCH (
            TRUE (),
            [Appraiser Visit Staff] = BLANK ()
                &amp;amp;&amp;amp; [Underwriter Visit Staff] = BLANK (), [Construction Visit Staff],
            [Appraiser Visit Staff] = BLANK ()
                &amp;amp;&amp;amp; [Underwriter Visit Staff] = BLANK (), [Construction Visit Staff],
            [Construction Visit Staff] = BLANK ()
                &amp;amp;&amp;amp; [Underwriter Visit Staff] = BLANK (), [Appraiser Visit Staff]
        ),
        _d
    )&lt;/LI-CODE&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Bubble&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 06:36:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2691539#M81071</guid>
      <dc:creator>Bubble4502</dc:creator>
      <dc:date>2022-08-10T06:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula for staff member associated with most recent visit date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2693340#M81166</link>
      <description>&lt;P&gt;Bubble,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, but I tried your solutions and they do not account for additional variables in my data. I've created a new table that includes 3 dates with corresponding names. The goal is the same: calculate the most recent date and the associated name that goes with that date. I am not sure how to paste the DAX code in here, so I've provided screenshots of both the table and the formulas I used. Thank you.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 18:51:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2693340#M81166</guid>
      <dc:creator>PBInewbie17</dc:creator>
      <dc:date>2022-08-10T18:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula for staff member associated with most recent visit date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2693742#M81194</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="128628" data-lia-user-login="PBInewbie17" class="lia-mention lia-mention-user"&gt;PBInewbie17&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Most Recent Visit Date =
VAR _a1 =
    IF ( ISBLANK ( 'Table'[Date 1] ), DATE ( 1899, 12, 31 ), 'Table'[Date 1] )
VAR _a2 =
    IF ( ISBLANK ( 'Table'[Date 2] ), DATE ( 1899, 12, 31 ), 'Table'[Date 2] )
VAR _a3 =
    IF ( ISBLANK ( 'Table'[Date 3] ), DATE ( 1899, 12, 31 ), 'Table'[Date 3] )
VAR _a =
    DATEDIFF ( _a1, _a2, DAY )
VAR _b =
    DATEDIFF ( _a2, _a3, DAY )
VAR _c =
    DATEDIFF ( _a1, _a3, DAY )
VAR _d =
    IF (
        _a &amp;lt;= 0,
        IF ( _c &amp;lt;= 0, 'Table'[Date 1], 'Table'[Date 3] ),
        IF ( _b &amp;lt;= 0, 'Table'[Date 2], 'Table'[Date 3] )
    )
RETURN
    IF ( _d = DATE ( 1899, 12, 31 ), BLANK (), _d )


Associated Name = 
VAR _a1 =
    IF ( ISBLANK ( 'Table'[Date 1] ), DATE ( 1899, 12, 31 ), 'Table'[Date 1] )
VAR _a2 =
    IF ( ISBLANK ( 'Table'[Date 2] ), DATE ( 1899, 12, 31 ), 'Table'[Date 2] )
VAR _a3 =
    IF ( ISBLANK ( 'Table'[Date 3] ), DATE ( 1899, 12, 31 ), 'Table'[Date 3] )
VAR _a =
    DATEDIFF ( _a1, _a2, DAY )
VAR _b =
    DATEDIFF ( _a2, _a3, DAY )
VAR _c =
    DATEDIFF ( _a1, _a3, DAY )
VAR _d =
    IF (
        _a &amp;lt;= 0,
        IF ( _c &amp;lt;= 0, 'Table'[Name 1], 'Table'[Name 3] ),
        IF ( _b &amp;lt;= 0, 'Table'[Name 2], 'Table'[Name 3] )
    )
RETURN
    IF (
        _d = BLANK (),
        SWITCH (
            TRUE (),
            'Table'[Name 1] = BLANK ()
                &amp;amp;&amp;amp; 'Table'[Name 3] = BLANK (), 'Table'[Name 2],
            'Table'[Name 1] = BLANK ()
                &amp;amp;&amp;amp; 'Table'[Name 2] = BLANK (), 'Table'[Name 3],
            'Table'[Name 2] = BLANK ()
                &amp;amp;&amp;amp; 'Table'[Name 3] = BLANK (), 'Table'[Name 1]
        ),
        _d
    )&lt;/LI-CODE&gt;&lt;P&gt;Final output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Bubble&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 02:13:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2693742#M81194</guid>
      <dc:creator>Bubble4502</dc:creator>
      <dc:date>2022-08-11T02:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX formula for staff member associated with most recent visit date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2695587#M81316</link>
      <description>&lt;P&gt;Thank you!! That worked.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 14:47:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-formula-for-staff-member-associated-with-most-recent-visit/m-p/2695587#M81316</guid>
      <dc:creator>PBInewbie17</dc:creator>
      <dc:date>2022-08-11T14:47:31Z</dc:date>
    </item>
  </channel>
</rss>

