<?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: Pulling a column based on the max value of a different column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502428#M69209</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Code =
VAR MaxQty = MAX ( Customers[Quantity] )
RETURN 
CALCULATE (
    MAXA ( Customers[Item Code] ),
    Customers[Quantity] = MaxQty
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 May 2022 14:55:01 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-05-09T14:55:01Z</dc:date>
    <item>
      <title>Pulling a column based on the max value of a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502275#M69198</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to pull the Item code based on max quantity. For example, if i filtered on customer ID AA, it should return the item code A3A. Is there a measure i can use to solve this?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:06:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502275#M69198</guid>
      <dc:creator>Keithlaf34</dc:creator>
      <dc:date>2022-05-09T14:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling a column based on the max value of a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502349#M69202</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="387551" data-lia-user-login="Keithlaf34" class="lia-mention lia-mention-user"&gt;Keithlaf34&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please try&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Code =
CALCULATE (
    MAX ( Customers[Item Code] ),
    Customers[Quantity] = MAX ( Customers[Quantity] )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 May 2022 14:32:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502349#M69202</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-09T14:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling a column based on the max value of a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502364#M69204</link>
      <description>&lt;P&gt;You could use TOPN, e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Top Product =
var currentCustomer = SELECTEDVALUE( 'Table'[Customer ID])
var summaryTable = TOPN( 1, 'Table', 'Table'[Quantity])
return IF( COUNTROWS(summaryTable) = 1, SELECTCOLUMNS( summaryTable, "@val", [Item Code]))&lt;/LI-CODE&gt;&lt;P&gt;This would return blank if there are 2 top products, but if you wanted to be able to display all tied products then you could run CONCATENATEX over the summary table&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:37:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502364#M69204</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-05-09T14:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling a column based on the max value of a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502416#M69208</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:50:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502416#M69208</guid>
      <dc:creator>Keithlaf34</dc:creator>
      <dc:date>2022-05-09T14:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling a column based on the max value of a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502428#M69209</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Code =
VAR MaxQty = MAX ( Customers[Quantity] )
RETURN 
CALCULATE (
    MAXA ( Customers[Item Code] ),
    Customers[Quantity] = MaxQty
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 14:55:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2502428#M69209</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-09T14:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling a column based on the max value of a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2503103#M69247</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;getting a different error unfortunately. appreciate the help.&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 21:08:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2503103#M69247</guid>
      <dc:creator>Keithlaf34</dc:creator>
      <dc:date>2022-05-09T21:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Pulling a column based on the max value of a different column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2509552#M69573</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="387551" data-lia-user-login="Keithlaf34" class="lia-mention lia-mention-user"&gt;Keithlaf34&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this, create the measure below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _selectedCustomre= SELECTEDVALUE(CustomerSlicer[Customer ID])
var _maxqty= MAXX(filter(ALL('Table'),'Table'[Customer ID]=_selectedCustomre),'Table'[Quantity])
var _maxItem=MAXX(FILTER(ALL('Table'),'Table'[Customer ID]=_selectedCustomre &amp;amp;&amp;amp; 'Table'[Quantity]= _maxqty),'Table'[Item Code])
return IF(ISFILTERED(CustomerSlicer[Customer ID]),_maxItem,"select customer")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P style="background: white;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;Community Support Team _Tang&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px;"&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 06:34:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Pulling-a-column-based-on-the-max-value-of-a-different-column/m-p/2509552#M69573</guid>
      <dc:creator>v-xiaotang</dc:creator>
      <dc:date>2022-05-12T06:34:42Z</dc:date>
    </item>
  </channel>
</rss>

