<?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 Retrieving Value from other table based on a condition and the distinct row value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrieving-Value-from-other-table-based-on-a-condition-and-the/m-p/2825243#M89808</link>
    <description>&lt;P&gt;Hi there,&lt;BR /&gt;for most of my challenges I found solutions within this forum. However, not for this one. I'm stuck in the thinking process and need support.&lt;BR /&gt;I have one imported table ('MBRMIG_Status') and one calculated table ('&lt;SPAN&gt;LatestMigStatusForEachMBR)&amp;nbsp;&lt;/SPAN&gt;which is related to the imported table via the "Vorgangsschluessel" (Document name)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The imported table has besides the three imported columns&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;two other calculated columns:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MigStatusGroup = IF(SUMX(Migrationstatus, FIND(UPPER(Migrationstatus[Migrated]), UPPER(MBRMIG_Status[LatestStatus], ,0)) &amp;gt; 0, "Migrated", BLANK())&lt;/LI-CODE&gt;&lt;P&gt;Instead of the Blank() there are 4 more If-conditions just with different status group wordings (besides "migrated", also "finished," "OtherStatus", ...).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestTransitionDate = CALCULATE(MAX(MBRMIG_Status[Transition to status last date]), ALLEXCEPT (MBRMIG_Status, MBRMIG_Status[Vorgangsschluessel]))&lt;/LI-CODE&gt;&lt;P&gt;Telling me what was the last date something changed for the specific document ("Vorgangsschluessel).&lt;BR /&gt;&lt;BR /&gt;My calculated column&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;was created based on having each "Vorgangsschluessel" just once:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestMigStatusForEachMBR = DISTINCT(SELECTCOLUMNS(MBRMIG_Status, MBRMIG_Status[Vorgangsschluessel]))&lt;/LI-CODE&gt;&lt;P&gt;and adding again the latest date:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestTransDate = CALCULATE(MAX(MBRMIG_Status[Transition to status last date]), ALLEXCEPT (LatestMigStatusForEachMBR, LatestMigStatusForEachMBR[MBRMIG_Status_Vorgangsschluessel]))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Now I struggle to fetch the MigStatusGroup from my 'MBRMIG_Status'-Table specific for the document name ("Vorgangsschluessel") and where the "LatestTransDate" (calulcated table) is the same as the "Transition to status date" (imported table).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestStatusOnThisDate = CALCULATE(
    COUNTROWS(MBRMIG_Status),
        FILTER(MBRMIG_Status, MBRMIG_Status[LatestTransitionDate] = LatestMigStatusForEachMBR[LatestTransDate])
        ALLEXCEPT(LatestMigStatusForEachMBR, LatestMigStatusForEachMBR[MBRMIG_Status_Vorgangsschluessel])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution should look like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any suggestions?&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 09:20:38 GMT</pubDate>
    <dc:creator>Cleo5</dc:creator>
    <dc:date>2022-10-07T09:20:38Z</dc:date>
    <item>
      <title>Retrieving Value from other table based on a condition and the distinct row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrieving-Value-from-other-table-based-on-a-condition-and-the/m-p/2825243#M89808</link>
      <description>&lt;P&gt;Hi there,&lt;BR /&gt;for most of my challenges I found solutions within this forum. However, not for this one. I'm stuck in the thinking process and need support.&lt;BR /&gt;I have one imported table ('MBRMIG_Status') and one calculated table ('&lt;SPAN&gt;LatestMigStatusForEachMBR)&amp;nbsp;&lt;/SPAN&gt;which is related to the imported table via the "Vorgangsschluessel" (Document name)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The imported table has besides the three imported columns&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;two other calculated columns:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MigStatusGroup = IF(SUMX(Migrationstatus, FIND(UPPER(Migrationstatus[Migrated]), UPPER(MBRMIG_Status[LatestStatus], ,0)) &amp;gt; 0, "Migrated", BLANK())&lt;/LI-CODE&gt;&lt;P&gt;Instead of the Blank() there are 4 more If-conditions just with different status group wordings (besides "migrated", also "finished," "OtherStatus", ...).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestTransitionDate = CALCULATE(MAX(MBRMIG_Status[Transition to status last date]), ALLEXCEPT (MBRMIG_Status, MBRMIG_Status[Vorgangsschluessel]))&lt;/LI-CODE&gt;&lt;P&gt;Telling me what was the last date something changed for the specific document ("Vorgangsschluessel).&lt;BR /&gt;&lt;BR /&gt;My calculated column&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;was created based on having each "Vorgangsschluessel" just once:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestMigStatusForEachMBR = DISTINCT(SELECTCOLUMNS(MBRMIG_Status, MBRMIG_Status[Vorgangsschluessel]))&lt;/LI-CODE&gt;&lt;P&gt;and adding again the latest date:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestTransDate = CALCULATE(MAX(MBRMIG_Status[Transition to status last date]), ALLEXCEPT (LatestMigStatusForEachMBR, LatestMigStatusForEachMBR[MBRMIG_Status_Vorgangsschluessel]))&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Now I struggle to fetch the MigStatusGroup from my 'MBRMIG_Status'-Table specific for the document name ("Vorgangsschluessel") and where the "LatestTransDate" (calulcated table) is the same as the "Transition to status date" (imported table).&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestStatusOnThisDate = CALCULATE(
    COUNTROWS(MBRMIG_Status),
        FILTER(MBRMIG_Status, MBRMIG_Status[LatestTransitionDate] = LatestMigStatusForEachMBR[LatestTransDate])
        ALLEXCEPT(LatestMigStatusForEachMBR, LatestMigStatusForEachMBR[MBRMIG_Status_Vorgangsschluessel])
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution should look like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 09:20:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrieving-Value-from-other-table-based-on-a-condition-and-the/m-p/2825243#M89808</guid>
      <dc:creator>Cleo5</dc:creator>
      <dc:date>2022-10-07T09:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Value from other table based on a condition and the distinct row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrieving-Value-from-other-table-based-on-a-condition-and-the/m-p/2825641#M89836</link>
      <description>&lt;P&gt;Solution was found by using more arguments in Lookupvalue&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LatestStatusOnThisDate = LOOKUPVALUE(MBRMIG_Status[MigStatusGroup], MBRMIG_Status[Vorgangsschluessel], LatestMigStatusForEachMBR[MBRMIG_Status_Vorgangsschluessel], MBRMIG_Status[Transition to status last date], LatestMigStatusForEachMBR[LatestTransDate])&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Oct 2022 11:48:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrieving-Value-from-other-table-based-on-a-condition-and-the/m-p/2825641#M89836</guid>
      <dc:creator>Cleo5</dc:creator>
      <dc:date>2022-10-07T11:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving Value from other table based on a condition and the distinct row value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrieving-Value-from-other-table-based-on-a-condition-and-the/m-p/2830531#M90162</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="450062" data-lia-user-login="Cleo5" class="lia-mention lia-mention-user"&gt;Cleo5&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can try the following methods&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sample data:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LatestTransDate = LOOKUPVALUE('Table'[LatestTransDate],'Table'[Vor],[Vor])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Column = CALCULATE(MAX('Table'[MigStatusGroup]),FILTER('Table',[Transition to status last date]=EARLIER('Table 2'[LatestTransDate])))&lt;/LI-CODE&gt;
&lt;P&gt;Refer to the attachment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 09:42:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Retrieving-Value-from-other-table-based-on-a-condition-and-the/m-p/2830531#M90162</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-10-10T09:42:57Z</dc:date>
    </item>
  </channel>
</rss>

