<?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 Lookup using DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2151612#M49599</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables: Cargo and Location Detials (Its a lookup/master table) and below are some sample data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cargo Table:



CargoId	 Origin 	 Destination
1	   01	           04
2	   02	           05
3	   03	           06


Location Details



LocationID	  LocationName
    01	             LOC01
    02	             LOC02
    03	             LOC03
    04	             LOC04
    05	             LOC05
    06	             LOC06&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requirement is to replace the Origin and Destination columns in Cargo table with actual location name from the Location Details master table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know how to achieve using DAX, i tried to create relationship and use LookUP but its not working as we cant maintain relationship with lookup table twice (one using Origin and LocationName, other using Destination and LocationName)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest any approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Oct 2021 02:33:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-24T02:33:01Z</dc:date>
    <item>
      <title>Lookup using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2151612#M49599</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables: Cargo and Location Detials (Its a lookup/master table) and below are some sample data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cargo Table:



CargoId	 Origin 	 Destination
1	   01	           04
2	   02	           05
3	   03	           06


Location Details



LocationID	  LocationName
    01	             LOC01
    02	             LOC02
    03	             LOC03
    04	             LOC04
    05	             LOC05
    06	             LOC06&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requirement is to replace the Origin and Destination columns in Cargo table with actual location name from the Location Details master table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know how to achieve using DAX, i tried to create relationship and use LookUP but its not working as we cant maintain relationship with lookup table twice (one using Origin and LocationName, other using Destination and LocationName)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest any approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 02:33:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2151612#M49599</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-24T02:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2151639#M49603</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Not sure what you mean when you say "&lt;EM&gt;Requirement is to &lt;STRONG&gt;replace&lt;/STRONG&gt; the Origin and Destination columns...&lt;/EM&gt;". You can't overwrite data or remove columns with DAX.&lt;/P&gt;&lt;P&gt;You can add two additional columns to your Cargo table, e.g.:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Origin Location =
LOOKUPVALUE ( Location[LocationName], Location[LocationID], Cargo[Origin] )&lt;/LI-CODE&gt;&lt;P&gt;A similar construction could be used to derive the Destination Location.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 05:36:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2151639#M49603</guid>
      <dc:creator>Jos_Woolley</dc:creator>
      <dc:date>2021-10-24T05:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2151656#M49606</link>
      <description>&lt;P&gt;To my understanding, LOOKUPVALUE is a legacy from Excel. Here's use a more PBI way to deal with it, which involves inactive relationship and expanded table,&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Name Org = CALCULATE(MAX(LOC[LocationName]), CARGO)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Name Dest =
CALCULATE(
    MAX( LOC[LocationName] ),
    CALCULATETABLE(
        CARGO,
        USERELATIONSHIP ( CARGO[Destination], LOC[LocationID] )
    )
)&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>Sun, 24 Oct 2021 06:20:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2151656#M49606</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2021-10-24T06:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2152344#M49631</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; you can use the following measures which works with or without any relationship&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;_origin =
CALCULATE (
    MAX ( Location[locationName] ),
    TREATAS ( VALUES ( Cargo[origin] ), Location[locationID] )
)

_destination =
CALCULATE (
    MAX ( Location[locationName] ),
    TREATAS ( VALUES ( Cargo[destination] ), Location[locationID] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 13:48:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2152344#M49631</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-10-25T13:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2160952#M49954</link>
      <description>&lt;P&gt;Thanks!&amp;nbsp;&lt;SPAN class="lia-mentions-gte-v2-autocomplete"&gt;&lt;SPAN class="lia-mentions-gte-v2-trigger"&gt;@&lt;/SPAN&gt;&lt;SPAN class="lia-mentions-search-term"&gt;smpa01 your solution worked for me.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 13:46:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-using-DAX/m-p/2160952#M49954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-28T13:46:43Z</dc:date>
    </item>
  </channel>
</rss>

