<?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: Lookup and return value based on a condition - not related tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2411293#M63528</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, I create a sample.&lt;/P&gt;
&lt;P&gt;This is Project part table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;This is Stage table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In my understanding, you want to create a column in the Project part table, when the Stadium code is 40, it should be 4 in my sample. Here's my solution.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
IF (
    'Project part'[Stadium code] = 40,
    LOOKUPVALUE ( Stage[Period number], Stage[Stadium code], 40 )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Get the result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Mar 2022 06:26:25 GMT</pubDate>
    <dc:creator>v-yanjiang-msft</dc:creator>
    <dc:date>2022-03-23T06:26:25Z</dc:date>
    <item>
      <title>Lookup and return value based on a condition - not related tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2400654#M62796</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a table (project part) containing the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;project number | project part number | Project part name | Stage code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to add a new column to this that shows when the project part number was at stage code 40, with the period number as the value. This data can be retrieved from another table (name: stage) that has no relationship with the project part table. I also can't create a relationship between these two tables due to ambiguity.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So my table should eventually look like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN&gt;project number&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;project part number &lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;Project part name&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;Stadium code&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;Period number closure&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;70220100&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;202201&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;70220102&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;Test2&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;202202&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried everything with LOOKUPVALUE and CALCULATE but I can't figure it out.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 12:55:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2400654#M62796</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-17T12:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and return value based on a condition - not related tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2400679#M62798</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , You can get value like . Table may not be related &lt;/P&gt;
&lt;P&gt;maxx(filter(Table2, Table2[Code] = table1[Code] ) , Table2[Value])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sumx(filter(Table2, Table2[Code] = table1[Code])&amp;nbsp; &amp;amp;&amp;amp; Table2[col] ="A"), Table2[Value])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer 4 ways to copy data from one table to another&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=Wu1mWxR23jU" target="_blank"&gt;https://www.youtube.com/watch?v=Wu1mWxR23jU&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=czNHt7UXIe8" target="_blank"&gt;https://www.youtube.com/watch?v=czNHt7UXIe8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 13:06:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2400679#M62798</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-17T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and return value based on a condition - not related tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2402974#M62972</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This didn't work. I get a error with:&lt;BR /&gt;the column period no. in the table d_period was not found or cannot be used in this expression.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;My relations are as follow:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;There is no direct relation between d_stadium and d_periode. I&lt;SPAN&gt;&amp;nbsp;can't create a relationship between these two tables due to ambiguity.&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;Hopefully this makes it clearer what the problem is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 10:40:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2402974#M62972</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-18T10:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and return value based on a condition - not related tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2411293#M63528</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, I create a sample.&lt;/P&gt;
&lt;P&gt;This is Project part table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;This is Stage table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In my understanding, you want to create a column in the Project part table, when the Stadium code is 40, it should be 4 in my sample. Here's my solution.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
IF (
    'Project part'[Stadium code] = 40,
    LOOKUPVALUE ( Stage[Period number], Stage[Stadium code], 40 )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Get the result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 06:26:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2411293#M63528</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-03-23T06:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup and return value based on a condition - not related tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2412410#M63593</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have found the solution via filters. So there was no formula&amp;nbsp;&lt;SPAN&gt;necessary.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for the help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 13:05:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Lookup-and-return-value-based-on-a-condition-not-related-tables/m-p/2412410#M63593</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-23T13:05:34Z</dc:date>
    </item>
  </channel>
</rss>

