<?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: Return values for the last date available in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212918#M52272</link>
    <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Download this file:&amp;nbsp;&lt;A href="https://gofile.io/d/A1SLih" target="_blank"&gt;https://gofile.io/d/A1SLih&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;BR /&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 01:54:24 GMT</pubDate>
    <dc:creator>VahidDM</dc:creator>
    <dc:date>2021-11-30T01:54:24Z</dc:date>
    <item>
      <title>Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212391#M52239</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am making a report with the following tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProjectList&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Project ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Project name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Project Owner&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;Project X&lt;/TD&gt;&lt;TD&gt;John Doe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Project Y&lt;/TD&gt;&lt;TD&gt;Jane Doe&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;StatusUpdates&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Project ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20/11/2021&lt;/TD&gt;&lt;TD&gt;Fixed issue 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;22/11/2021&lt;/TD&gt;&lt;TD&gt;Fixed issue 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;21/11/2021&lt;/TD&gt;&lt;TD&gt;Fixed issue 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;24/11/2021&lt;/TD&gt;&lt;TD&gt;Fixed issue 4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ProjectList" filters "StatusUpdates" based on the column "ProjectID". I essentially imported the first table as a table in my report, and I would like to achieve that by clicking on one of the values in that table, it returns the string value in the column "Update" of the table "StatusUpdates" of the latest date. So essentially, when you would click on project 1 in the table, it would return the value "Fixed issue 3" on a card, which is the third record in the second table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried with SELECTEDVALUE() but I'm not able to fix the issue. Can someone help me?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 16:57:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212391#M52239</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-29T16:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212456#M52241</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; you can use a measure like this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
CALCULATE (
    MAX ( StatusUpdates[Update] ),
    FILTER (
        VALUES ( StatusUpdates ),
        StatusUpdates[Date]
            = CALCULATE (
                MAX ( StatusUpdates[Date] ),
                ALLEXCEPT ( ProjectList, ProjectList[Project ID] )
            )
    )
)
&lt;/LI-CODE&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;</description>
      <pubDate>Mon, 29 Nov 2021 17:26:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212456#M52241</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-29T17:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212475#M52244</link>
      <description>&lt;P&gt;Hi, unfortunately it does not work for meand it even seems to return the first registered values, not the last ones...&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 17:38:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212475#M52244</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-29T17:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212482#M52245</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;pbix is attached. Please post your pbix if it does not help. I will take a look.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 17:42:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212482#M52245</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-29T17:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212489#M52247</link>
      <description>&lt;P&gt;This appears to work but I'd recommend defining a variable for MaxDate for several reasons:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Performance. You don't have to recalculate for each row of the table you're filtering.&lt;/LI&gt;
&lt;LI&gt;Robustness. Avoid potential trouble arising from a context transition inside FILTER.&lt;/LI&gt;
&lt;LI&gt;Readability. Broken up a bit, the&amp;nbsp;code is often easier for humans to understand.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 29 Nov 2021 17:48:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212489#M52247</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-11-29T17:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212538#M52250</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi, yours works indeed. I took out the sensitive data out of mine and replaced with dummy data. I tried to keep it as original as possible so some of the column names are different but its the same principle. I am putting in a wetransfer link as I cannot upload files in these posts yet :&amp;nbsp;&lt;A href="https://we.tl/t-FevGPdVk3Y" target="_blank"&gt;https://we.tl/t-FevGPdVk3Y&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 18:20:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212538#M52250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-29T18:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212573#M52251</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; returned and attached&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _0 =
    MAX ( 'Project Status'[Created] )
RETURN
    CALCULATE (
        MAX ( 'Project Status'[Status Budget] ),
        FILTER (
            VALUES ( 'Project Status' ),
            'Project Status'[Created]
                = CALCULATE ( _0, ALLEXCEPT ( 'Project Status', 'Project Status'[ProjectId] ) )
        )
    )
&lt;/LI-CODE&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;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp; thanks !!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 18:53:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212573#M52251</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-11-29T18:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212724#M52255</link>
      <description>&lt;P&gt;Not quite what I meant. Once a variable is defined, adjusting its filter context with CALCULATE doesn't do anything, so your DAX is equivalent to&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _0 = MAX ( 'Project Status'[Created] )
RETURN
    CALCULATE (
        MAX ( 'Project Status'[Status Budget] ),
        FILTER ( VALUES ( 'Project Status' ), 'Project Status'[Created] = _0 )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was suggesting something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR ProjectLastCreated =
    CALCULATE (
        MAX ( 'Project Status'[Created] ),
        ALLEXCEPT ( 'Project Status', 'Project Status'[ProjectId] )
    )
RETURN
    CALCULATE (
        MAX ( 'Project Status'[Status Budget] ),
        'Project Status'[Created] = ProjectLastCreated
    )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Nov 2021 22:08:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212724#M52255</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-11-29T22:08:09Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for the last date available</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212918#M52272</link>
      <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Download this file:&amp;nbsp;&lt;A href="https://gofile.io/d/A1SLih" target="_blank"&gt;https://gofile.io/d/A1SLih&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;STRONG&gt;accepting&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;BR /&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 01:54:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-the-last-date-available/m-p/2212918#M52272</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-11-30T01:54:24Z</dc:date>
    </item>
  </channel>
</rss>

