<?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: Get Max of a column grouping by another columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903555#M94646</link>
    <description>&lt;DIV&gt;In such case, typically a table would be created with the code below:&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;MaxTable =&lt;DIV&gt;ADDCOLUMNS(&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; SUMMARIZE (Data, Data[Project], Data[Category]),&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; "MaxValue",&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; CALCULATE (MAX(Data[Value]))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With SUMMARIZE, we could include and summarize columns as many as needed. Columns from other table could also be included, as long as they are from a table on the one side of the relationship with Data table.&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 14 Nov 2022 11:51:50 GMT</pubDate>
    <dc:creator>FreemanZ</dc:creator>
    <dc:date>2022-11-14T11:51:50Z</dc:date>
    <item>
      <title>Get Max of a column grouping by another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903341#M94625</link>
      <description>&lt;P&gt;I have a table similar to this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;all what I want is to add a new measure to a table in power bi that returns the maximum "Value" grouped by "Project" and "Category" columns&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 09:55:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903341#M94625</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-14T09:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get Max of a column grouping by another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903387#M94628</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, please try this measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MaxValueByProjectAndCategory = 
    CALCULATE(
        MAX('Table1'[Value])
        ,ALL('Table1'[Date])
    )&lt;/LI-CODE&gt;&lt;P&gt;This yeilds these results:&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;</description>
      <pubDate>Mon, 14 Nov 2022 10:13:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903387#M94628</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-14T10:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get Max of a column grouping by another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903456#M94634</link>
      <description>&lt;P&gt;Thanks EylesIT,&lt;BR /&gt;But the table above is just for example.&amp;nbsp;&lt;BR /&gt;Say that I have a table of 20 columns and I want to get the max of one column grouping by another two columns ...it won't be practical to exclude all the other 17 columns .... is there another way?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 10:51:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903456#M94634</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-14T10:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get Max of a column grouping by another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903495#M94641</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, Could you please post a sample data table with the 20 columns and what the expected output should be, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you say "it won't be practical to exclude all the other 17 columns" do you mean that you want to display all 20 columns in the table visual, but you still want this measure to only group by the Product and Category per row? If that is the case, then try this version of the measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MaxValueByProjectAndCategory = 
    VAR vProject = SELECTEDVALUE('Table1'[Project])
    VAR vCategory = SELECTEDVALUE('Table1'[Category])
    RETURN
    CALCULATE(
        MAX('Table1'[Value])
        ,ALL('Table1')
        ,'Table1'[Project] = vProject
        ,'Table1'[Category] = vCategory
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2022 11:21:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903495#M94641</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-14T11:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get Max of a column grouping by another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903555#M94646</link>
      <description>&lt;DIV&gt;In such case, typically a table would be created with the code below:&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;MaxTable =&lt;DIV&gt;ADDCOLUMNS(&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; SUMMARIZE (Data, Data[Project], Data[Category]),&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; "MaxValue",&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; CALCULATE (MAX(Data[Value]))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With SUMMARIZE, we could include and summarize columns as many as needed. Columns from other table could also be included, as long as they are from a table on the one side of the relationship with Data table.&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Nov 2022 11:51:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2903555#M94646</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-11-14T11:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get Max of a column grouping by another columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2923054#M95914</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;I suggest that you can use CALCULATE function and EARLIER function to create a calculated column, then you will get the expected result.&lt;/P&gt;
&lt;P&gt;Sample data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create a column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column =
CALCULATE (
    MAX ( 'table1'[VALUE] ),
    FILTER (
        'table1',
        'table1'[Project] = EARLIER ( 'table1'[Project] )
            &amp;amp;&amp;amp; 'table1'[Category] = EARLIER ( 'table1'[Category] )
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attach my sample below for your reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ xiaosun&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps,&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2022 02:02:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Max-of-a-column-grouping-by-another-columns/m-p/2923054#M95914</guid>
      <dc:creator>v-xiaosun-msft</dc:creator>
      <dc:date>2022-11-23T02:02:21Z</dc:date>
    </item>
  </channel>
</rss>

