<?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: Returning a field value based on information in two columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-a-field-value-based-on-information-in-two-columns/m-p/2373942#M61044</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer this formula.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _min_date = CALCULATE(MIN('Table'[date]),FILTER(ALLSELECTED('Table'),'Table'[User]=SELECTEDVALUE('Table'[User])&amp;amp;&amp;amp;'Table'[Test#]=SELECTEDVALUE('Table'[Test#])))
return
CALCULATE(MAX('Table'[Result]),FILTER(ALLSELECTED('Table'),'Table'[User]=SELECTEDVALUE('Table'[User])&amp;amp;&amp;amp;'Table'[date]=_min_date))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jay&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2022 02:43:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-03-04T02:43:05Z</dc:date>
    <item>
      <title>Returning a field value based on information in two columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-a-field-value-based-on-information-in-two-columns/m-p/2368792#M60714</link>
      <description>&lt;P&gt;I need help writing a DAX function that returns the first test result for an individual user. For example, William has taken test 1 twice, but I only need to know that he passed it on attempt one. In this case, if there are multiple test results for a user, I am only interested in the first result. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample table.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;User&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Test#&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Result&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Joe&lt;/TD&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Pass&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Carol&lt;/TD&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Pass&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;William&lt;/TD&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Pass&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;William&lt;/TD&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;In Progress&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Steven&lt;/TD&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Not Started&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Joe&lt;/TD&gt;&lt;TD&gt;Test2&lt;/TD&gt;&lt;TD&gt;Not Started&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Steven&lt;/TD&gt;&lt;TD&gt;Test1&lt;/TD&gt;&lt;TD&gt;Pass&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Carol&lt;/TD&gt;&lt;TD&gt;Test2&lt;/TD&gt;&lt;TD&gt;Not Started&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;William&lt;/TD&gt;&lt;TD&gt;Test2&lt;/TD&gt;&lt;TD&gt;Pass&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;William&lt;/TD&gt;&lt;TD&gt;Test2&lt;/TD&gt;&lt;TD&gt;In Progress&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 02 Mar 2022 02:23:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-a-field-value-based-on-information-in-two-columns/m-p/2368792#M60714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-02T02:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a field value based on information in two columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-a-field-value-based-on-information-in-two-columns/m-p/2368864#M60716</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , do you have date column to check the first date. &lt;/P&gt;
&lt;P&gt;Or add an index column in power query &lt;A href="https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi" target="_blank"&gt;https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Column =&lt;/P&gt;
&lt;P&gt;var _1 = minx(filter(table, [user] = earlier([user]) &amp;amp;&amp;amp; [Test #] = earlier([Test #]) ), [index] )&lt;BR /&gt;return &lt;BR /&gt;if(_1 =[Index] &amp;amp;&amp;amp; [Result] = "Pass" , 1,0)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 02:47:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-a-field-value-based-on-information-in-two-columns/m-p/2368864#M60716</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-02T02:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a field value based on information in two columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-a-field-value-based-on-information-in-two-columns/m-p/2373942#M61044</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer this formula.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _min_date = CALCULATE(MIN('Table'[date]),FILTER(ALLSELECTED('Table'),'Table'[User]=SELECTEDVALUE('Table'[User])&amp;amp;&amp;amp;'Table'[Test#]=SELECTEDVALUE('Table'[Test#])))
return
CALCULATE(MAX('Table'[Result]),FILTER(ALLSELECTED('Table'),'Table'[User]=SELECTEDVALUE('Table'[User])&amp;amp;&amp;amp;'Table'[date]=_min_date))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jay&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 02:43:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Returning-a-field-value-based-on-information-in-two-columns/m-p/2373942#M61044</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-03-04T02:43:05Z</dc:date>
    </item>
  </channel>
</rss>

