<?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 in SAME TABLE in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087274#M47482</link>
    <description>&lt;P&gt;Ahh.. DIdn't understand TransactionGroup was the expected result. Try this&amp;nbsp;Anonymous&lt;/LI-USER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
VAR varItemGroup = 'Table'[Item Group]
VAR varItem = 'Table'[Item]
VAR varTransaction = 'Table'[Transaction No]
RETURN
    IF(
        varItemGroup = "MB",
        MINX(
            FILTER(
                'Table',
                'Table'[Transaction No] = varTransaction
                    &amp;amp;&amp;amp; 'Table'[Item] &amp;lt; varItem
            ),
            'Table'[Item Group]
        ),
        'Table'[Item Group]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 00:46:29 GMT</pubDate>
    <dc:creator>edhans</dc:creator>
    <dc:date>2021-09-21T00:46:29Z</dc:date>
    <item>
      <title>LOOKUP in SAME TABLE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087214#M47473</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to ask assistance in the scenario below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;currently have a table with the first three columns, and I want to add a column for the Transaction Group.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Rules:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;gt; If Item group is MB, get the first item group with same transaction no.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;gt; If item is not MB, get row item group.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Transaction No&lt;/TD&gt;&lt;TD&gt;Item&lt;/TD&gt;&lt;TD&gt;Item Group&lt;/TD&gt;&lt;TD&gt;Transaction Group&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1001&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1002&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1015&lt;/TD&gt;&lt;TD&gt;MB&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1004&lt;/TD&gt;&lt;TD&gt;RR&lt;/TD&gt;&lt;TD&gt;RR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1015&lt;/TD&gt;&lt;TD&gt;MB&lt;/TD&gt;&lt;TD&gt;RR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1001&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1002&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1015&lt;/TD&gt;&lt;TD&gt;MB&lt;/TD&gt;&lt;TD&gt;AN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;1020&lt;/TD&gt;&lt;TD&gt;RR&lt;/TD&gt;&lt;TD&gt;RR&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 23:50:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087214#M47473</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-20T23:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP in SAME TABLE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087218#M47475</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Maybe:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Transaction Group = 
  IF(
    "Item Group" = "MB",
        VAR __First = MINX(FILTER('Table',[Transaction]=EARLIER([Transaction])),[Item])
      RETURN
        MAXX(FILTER('Table',[Transaction]=EARLIER([Transaction]) &amp;amp;&amp;amp; [Item]=__First),[Item Group]),
      [Item Group]
   )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 20 Sep 2021 23:56:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087218#M47475</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-20T23:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP in SAME TABLE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087220#M47476</link>
      <description>&lt;P&gt;Is this what you want?&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You said you wanted the "row item group" if Item Group wasn't MB, but I wasn't sure what that meant. I pulled the item group from the same row.&lt;BR /&gt;&lt;BR /&gt;Code here:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
VAR varItemGroup = 'Table'[Item Group]
VAR varTransaction = 'Table'[Transaction No]
RETURN
    IF(
        varItemGroup = "MB",
        MINX(
            FILTER(
                'Table',
                'Table'[Transaction No] = varTransaction
            ),
            'Table'[Transaction Group]
        ),
        'Table'[Item Group]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: This is a calculated column formula and must be entered as a New Column to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Sep 2021 23:56:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087220#M47476</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2021-09-20T23:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP in SAME TABLE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087227#M47479</link>
      <description>&lt;P&gt;Hi. noticed that you used the transaction group column in the formula. What i meant was that, I am trying to have the trans group column be the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 00:05:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087227#M47479</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-21T00:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP in SAME TABLE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087236#M47480</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;I think I got it correct, please check, I did not use Transaction Group in my formula.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 00:15:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087236#M47480</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-21T00:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP in SAME TABLE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087267#M47481</link>
      <description>&lt;P&gt;Hi Greg, this worked for my sample dataset. will check on the full dataset before accepting as solution. thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 00:36:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087267#M47481</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-21T00:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: LOOKUP in SAME TABLE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087274#M47482</link>
      <description>&lt;P&gt;Ahh.. DIdn't understand TransactionGroup was the expected result. Try this&amp;nbsp;Anonymous&lt;/LI-USER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
VAR varItemGroup = 'Table'[Item Group]
VAR varItem = 'Table'[Item]
VAR varTransaction = 'Table'[Transaction No]
RETURN
    IF(
        varItemGroup = "MB",
        MINX(
            FILTER(
                'Table',
                'Table'[Transaction No] = varTransaction
                    &amp;amp;&amp;amp; 'Table'[Item] &amp;lt; varItem
            ),
            'Table'[Item Group]
        ),
        'Table'[Item Group]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 00:46:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/LOOKUP-in-SAME-TABLE/m-p/2087274#M47482</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2021-09-21T00:46:29Z</dc:date>
    </item>
  </channel>
</rss>

