<?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: Reference a row in another column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-a-row-in-another-column/m-p/2162594#M50005</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329279" data-lia-user-login="pagliaci" class="lia-mention lia-mention-user"&gt;pagliaci&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, I can clearly understand your requirement, you can try to create a calculated column like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =

var _lastID=CALCULATE(MAX('Table'[ID]),FILTER(ALL('Table'),[INDEX]=EARLIER('Table'[INDEX])-1))

return

IF([ID]=_lastID,"SAME ID","DIFFERENT ID")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you can get what you want, like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can download my test pbix file below&lt;/P&gt;
&lt;P&gt;Thank you very much!&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 _Robert Qin&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 07:17:07 GMT</pubDate>
    <dc:creator>v-robertq-msft</dc:creator>
    <dc:date>2021-10-29T07:17:07Z</dc:date>
    <item>
      <title>Reference a row in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-a-row-in-another-column/m-p/2150258#M49531</link>
      <description>&lt;P&gt;Hello, I hve two columns in the same table, onde of them is the index one, I want to reference the id number of that index, for example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INDEX&lt;/P&gt;&lt;P&gt;8027890&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;9809887&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp;&lt;/P&gt;&lt;P&gt;2938878&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need is to find out if an ID was entered twice, so I need&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the ((ID of index 1)-(ID of index -1))=0, "SAME ID", "DIFFERENT ID"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I make this reference tho?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank a lot!!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 10:53:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-a-row-in-another-column/m-p/2150258#M49531</guid>
      <dc:creator>pagliaci</dc:creator>
      <dc:date>2021-10-22T10:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reference a row in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-a-row-in-another-column/m-p/2150331#M49535</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Calculated Column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Duplicate? =
VAR MyID = 'Table'[ID]
VAR MyIDCount =
    CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', 'Table'[ID] = MyID ) )
RETURN
    IF ( MyIDCount &amp;gt; 1, "Duplicate" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 11:51:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-a-row-in-another-column/m-p/2150331#M49535</guid>
      <dc:creator>Jos_Woolley</dc:creator>
      <dc:date>2021-10-22T11:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reference a row in another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-a-row-in-another-column/m-p/2162594#M50005</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="329279" data-lia-user-login="pagliaci" class="lia-mention lia-mention-user"&gt;pagliaci&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, I can clearly understand your requirement, you can try to create a calculated column like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =

var _lastID=CALCULATE(MAX('Table'[ID]),FILTER(ALL('Table'),[INDEX]=EARLIER('Table'[INDEX])-1))

return

IF([ID]=_lastID,"SAME ID","DIFFERENT ID")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you can get what you want, like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can download my test pbix file below&lt;/P&gt;
&lt;P&gt;Thank you very much!&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 _Robert Qin&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 07:17:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-a-row-in-another-column/m-p/2162594#M50005</guid>
      <dc:creator>v-robertq-msft</dc:creator>
      <dc:date>2021-10-29T07:17:07Z</dc:date>
    </item>
  </channel>
</rss>

