<?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 Calculated max value by using group by for multiple columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/823544#M5697</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to&amp;nbsp;calculate the max value by using group by for multiple columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Have this table :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What&amp;nbsp; I want to do is to calculate the max amount for each "Id offer" by selecting the "Rev" with the maximum amount for each "Id client"&amp;nbsp; as below :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the offer has multiple "Id client" , in this case selecting the "Id client" column with the max value as below :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying this but it doesn't work :&lt;/P&gt;&lt;PRE&gt;Max amount = GROUPBY( 
            ADDCOLUMNS(
                GROUPBY(
                    Tableau_Quotation,
                    'Tableau_Quotation'[Document Nr],
                    'Tableau_Quotation'[Rev],
                ),
                "Max Count", CALCULATE(MAX(Tableau_Quotation[Offer amount EUR]))
            ),
            'Tableau_Quotation'[Document Nr],
            "Max", MAXX(CURRENTGROUP(), [Max Count]))&lt;/PRE&gt;&lt;P&gt;How I can fix that with dax ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2019 15:23:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-21T15:23:16Z</dc:date>
    <item>
      <title>Calculated max value by using group by for multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/823544#M5697</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to&amp;nbsp;calculate the max value by using group by for multiple columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Have this table :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What&amp;nbsp; I want to do is to calculate the max amount for each "Id offer" by selecting the "Rev" with the maximum amount for each "Id client"&amp;nbsp; as below :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the offer has multiple "Id client" , in this case selecting the "Id client" column with the max value as below :&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying this but it doesn't work :&lt;/P&gt;&lt;PRE&gt;Max amount = GROUPBY( 
            ADDCOLUMNS(
                GROUPBY(
                    Tableau_Quotation,
                    'Tableau_Quotation'[Document Nr],
                    'Tableau_Quotation'[Rev],
                ),
                "Max Count", CALCULATE(MAX(Tableau_Quotation[Offer amount EUR]))
            ),
            'Tableau_Quotation'[Document Nr],
            "Max", MAXX(CURRENTGROUP(), [Max Count]))&lt;/PRE&gt;&lt;P&gt;How I can fix that with dax ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 15:23:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/823544#M5697</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-21T15:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated max value by using group by for multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/823674#M5705</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;If I understand this correctly, you are creating a new table. I used SUMMARIZE and LOOKUPVALUE&lt;/P&gt;&lt;PRE&gt;new = SUMMARIZE('Table','Table'[ID Offer],'Table'[ID Client],"AMT",max('Table'[Amount])),
==
Lookup = LOOKUPVALUE('Table'[Rev],'Table'[Amount],new[AMT],'Table'[ID Offer],new[ID Offer],'Table'[ID Client],new[ID Client])&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;are nice too.&lt;BR /&gt;Nathaniel&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Will post pbix shortly.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 17:37:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/823674#M5705</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-10-21T17:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated max value by using group by for multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/823676#M5706</link>
      <description>&lt;P&gt;PBIX file&amp;nbsp;&lt;A href="https://1drv.ms/u/s!AgCd7AyfqZtEyRbefUlC093owF9E?e=Bdu4Mn" target="_blank" rel="noopener"&gt;PBIX&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 17:38:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/823676#M5706</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-10-21T17:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated max value by using group by for multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/824228#M5727</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your response &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159166" data-lia-user-login="Nathaniel_C" class="lia-mention lia-mention-user"&gt;Nathaniel_C&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's possible I'd like to not create a new table but creating a new measure at the same table.&lt;/P&gt;&lt;P&gt;Otherwise with your solution you miss the last step by selecting the "Id offer" with the max "AMT":&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Id Offer | ID Client | AMT | Lookup&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; 150 |&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we use the same functions without creating a new table but stay with the same table ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thnak you again for your answer!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 06:19:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/824228#M5727</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-22T06:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated max value by using group by for multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/824956#M5751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Maybe I am not seeing for what you are looking.&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;are nice too.&lt;BR /&gt;Nathaniel&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aren't these the same?&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 13:38:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/824956#M5751</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-10-22T13:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated max value by using group by for multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/824962#M5752</link>
      <description>&lt;P&gt;Hii,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added a step to select the line with the max amount...&lt;/P&gt;&lt;P&gt;Thank you again for your answer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 13:42:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/824962#M5752</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-22T13:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated max value by using group by for multiple columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/824981#M5753</link>
      <description>&lt;P&gt;You are welcome!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 13:50:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-max-value-by-using-group-by-for-multiple-columns/m-p/824981#M5753</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2019-10-22T13:50:42Z</dc:date>
    </item>
  </channel>
</rss>

