<?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: Dax filter of all rows based on max value - SQL equivalent in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150939#M164939</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;&amp;nbsp;&amp;nbsp;Not sure what your question is.&amp;nbsp; Maybe open a new thread?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 14 Sep 2024 20:45:27 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-09-14T20:45:27Z</dc:date>
    <item>
      <title>Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4138967#M164418</link>
      <description>&lt;P&gt;Ok so currently I have a table with a multitude of columns and rows. What I want to do is filter all the rows based on the maximum value of one column OrderID for the CustomerID.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table looks like This:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CustomerID&lt;/TD&gt;&lt;TD&gt;CustName&lt;/TD&gt;&lt;TD&gt;OrderID&lt;/TD&gt;&lt;TD&gt;OrderDate&lt;/TD&gt;&lt;TD&gt;OrderStatus&lt;/TD&gt;&lt;TD&gt;OrderReceivedDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;1114&lt;/TD&gt;&lt;TD&gt;01/01/2024&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;TD&gt;01/08/2024&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;1115&lt;/TD&gt;&lt;TD&gt;01/10/2024&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;TD&gt;01/15/2024&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Dan&lt;/TD&gt;&lt;TD&gt;2212&lt;/TD&gt;&lt;TD&gt;03/05/2024&lt;/TD&gt;&lt;TD&gt;Shipped&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Dan&lt;/TD&gt;&lt;TD&gt;3457&lt;/TD&gt;&lt;TD&gt;03/06/2024&lt;/TD&gt;&lt;TD&gt;Shipped&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Dan&lt;/TD&gt;&lt;TD&gt;4875&lt;/TD&gt;&lt;TD&gt;03/08/2024&lt;/TD&gt;&lt;TD&gt;Shipped&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD&gt;1112&lt;/TD&gt;&lt;TD&gt;12/17/2023&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;TD&gt;12/26/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD&gt;5555&lt;/TD&gt;&lt;TD&gt;03/10/2024&lt;/TD&gt;&lt;TD&gt;Pending&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;Frank&lt;/TD&gt;&lt;TD&gt;1110&lt;/TD&gt;&lt;TD&gt;12/10/2023&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;TD&gt;12/15/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;Frank&lt;/TD&gt;&lt;TD&gt;6758&lt;/TD&gt;&lt;TD&gt;03/18/2024&lt;/TD&gt;&lt;TD&gt;Pending&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;Frank&lt;/TD&gt;&lt;TD&gt;6759&lt;/TD&gt;&lt;TD&gt;03/18/2024&lt;/TD&gt;&lt;TD&gt;Shipped&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically in SQL what I am trying to accomplish would be written like the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM myTable a1&lt;/P&gt;&lt;P&gt;where a1.OrderID = (select max(b1.OrderID)&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; from myTable b1&lt;/P&gt;&lt;P&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; where b1.CustomerID = a1.CustomerID)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CustomerID&lt;/TD&gt;&lt;TD&gt;CustName&lt;/TD&gt;&lt;TD&gt;OrderID&lt;/TD&gt;&lt;TD&gt;OrderDate&lt;/TD&gt;&lt;TD&gt;OrderStatus&lt;/TD&gt;&lt;TD&gt;OrderReceivedDate&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;John&lt;/TD&gt;&lt;TD&gt;1115&lt;/TD&gt;&lt;TD&gt;01/10/2024&lt;/TD&gt;&lt;TD&gt;Complete&lt;/TD&gt;&lt;TD&gt;01/15/2024&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Dan&lt;/TD&gt;&lt;TD&gt;4875&lt;/TD&gt;&lt;TD&gt;03/08/2024&lt;/TD&gt;&lt;TD&gt;Shipped&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD&gt;5555&lt;/TD&gt;&lt;TD&gt;03/10/2024&lt;/TD&gt;&lt;TD&gt;Pending&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;Frank&lt;/TD&gt;&lt;TD&gt;6759&lt;/TD&gt;&lt;TD&gt;03/18/2024&lt;/TD&gt;&lt;TD&gt;Shipped&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I can achieve this by the following Dax measure:&amp;nbsp;&lt;/P&gt;&lt;P&gt;isMax = IF(myTable[OrderID] = CALCULATE(MAX(myTable[OrderID],AllEXCEPT(myTable[CustomerID])), 1, 0)&lt;BR /&gt;&lt;BR /&gt;then I filter that measure to 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel like there has to be another way to do this right? Maybe creating a new table to do this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 17:37:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4138967#M164418</guid>
      <dc:creator>jswartz_09</dc:creator>
      <dc:date>2024-09-07T17:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4139025#M164421</link>
      <description>&lt;P&gt;Since this data is immutable you can create a calculated column, or do this in Power Query.&amp;nbsp; (or even in SQL if you want)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jZDBCsIwEER/RXoWurtpmnhV8eBJ8Fh6qDTYoqZF/H/csNHSWtEQyO7whmFSFAkmy2TfNZ4fRMz4AUz5ElBYNt2tv7qHi7oVvVxOjVoAhHkj6sFILG2r4CPCsIBKQb98x6bte1fztJjQKtMm0vlvOrNGR9p+oxVP6+4kDYIVKUUTaDVuwDrloo99mo+kDM0PztetP79Tgra7V/4iORBzYD5Hfkp9OHOjbUyy/yQxv5ryo/7lEw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CustomerID = _t, CustName = _t, OrderID = _t, OrderDate = _t, OrderStatus = _t, OrderReceivedDate = _t]),
    #"Grouped Rows" = Table.Group(Source, {"CustomerID"}, {{"Rows", each _, type table [CustomerID=nullable text, CustName=nullable text, OrderID=nullable text, OrderDate=nullable text, OrderStatus=nullable text, OrderReceivedDate=nullable text]}, {"Max Order", each List.Max([OrderID]), type nullable text}}),
    #"Expanded Rows" = Table.ExpandTableColumn(#"Grouped Rows", "Rows", {"CustName", "OrderID", "OrderDate", "OrderStatus", "OrderReceivedDate"}, {"CustName", "OrderID", "OrderDate", "OrderStatus", "OrderReceivedDate"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded Rows", each ([OrderID] = [Max Order])),
    #"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Max Order"})
in
    #"Removed Columns"&lt;/LI-CODE&gt;
&lt;P&gt;How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the Source step with your own source.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2024 20:40:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4139025#M164421</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-07T20:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150230#M164895</link>
      <description>&lt;P&gt;This is nice for power query, but how would you do this in Dax?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 21:10:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150230#M164895</guid>
      <dc:creator>jswartz_09</dc:creator>
      <dc:date>2024-09-13T21:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150255#M164897</link>
      <description>&lt;P&gt;A calculated column that you can use for filtering:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 21:51:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150255#M164897</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-13T21:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150278#M164898</link>
      <description>&lt;P&gt;Yeah that's what I've been doing. Sorry I'm being difficult but is there another way? Or better way?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 22:26:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150278#M164898</guid>
      <dc:creator>jswartz_09</dc:creator>
      <dc:date>2024-09-13T22:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150281#M164899</link>
      <description>&lt;P&gt;What do you not like about this way?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 22:34:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150281#M164899</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-13T22:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150301#M164900</link>
      <description>&lt;P&gt;Nothing I don't like. Just wondering if there are other ways&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 22:51:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150301#M164900</guid>
      <dc:creator>jswartz_09</dc:creator>
      <dc:date>2024-09-13T22:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150304#M164901</link>
      <description>&lt;P&gt;There are, but most likely they will perform worse&amp;nbsp; (depends on the size of your table too).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If in doubt - use DAX Studio to measure query performance and examine the query plan.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 22:53:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150304#M164901</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-13T22:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150316#M164902</link>
      <description>&lt;P&gt;How about this ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Customer_Measure_Id =
VAR _OrderId =
    MAX ( 'Tbl'[OrderID] )
VAR _MaxOrder =
    SUMMARIZE (
        ALL ( 'Tbl' ),
        'Tbl'[CustomerID],
        "OrderId", MAX ( 'Tbl'[OrderID] )
    )
VAR FilterVar =
    FILTER ( _MaxOrder, [OrderId] = _OrderId )
RETURN
    MAXX ( FilterVar, 'Tbl'[CustomerID] )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;Just replace CustomerId column with&amp;nbsp;Customer_Measure_Id&amp;nbsp; in the display.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2024 23:22:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150316#M164902</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-09-13T23:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150390#M164906</link>
      <description>&lt;P&gt;Multiple red flags.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/all-the-secrets-of-summarize/" target="_blank"&gt;https://www.sqlbi.com/articles/all-the-secrets-of-summarize/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again - use DAX Studio to measure for yourself. No need to guess.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Sep 2024 01:00:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150390#M164906</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-14T01:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150912#M164937</link>
      <description>&lt;P&gt;Thats interesting.Thanks for pointing that out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the article you quoted doesnt necessarily states that using SUMMARIZE are red flags but explains the limitations of using it wrt to extended columns and suggests usage of ADDCOLUMNS with CALCULATE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a better explaination here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/best-practices-using-summarize-and-addcolumns" target="_blank" rel="noopener"&gt;https://www.sqlbi.com/articles/best-practices-using-summarize-and-addcolumns&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The best practice proposed is to use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ADDCOLUMNS(
SUMMARIZE( &amp;lt;table&amp;gt;, &amp;lt;group by column&amp;gt; ),
&amp;lt;column_name&amp;gt;, CALCULATE( &amp;lt;expression&amp;gt; )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which I agree. But in my solution the change isnt working. I changed the DAX from this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _MaxOrder = SUMMARIZE (
ALL ( Tbl ),
'Tbl'[CustomerID],
"Order_Id", ( MAX ( 'Tbl'[OrderID] ) )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR _MaxOrder = ADDCOLUMNS (
SUMMARIZE ( ALL ( Tbl ), 'Tbl'[CustomerID] ),
"Order_Id", CALCULATE ( MAX ( 'Tbl'[OrderID] ) )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it doesnt work.Any thoughts ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Sep 2024 11:06:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150912#M164937</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-09-15T11:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150939#M164939</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;&amp;nbsp;&amp;nbsp;Not sure what your question is.&amp;nbsp; Maybe open a new thread?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Sep 2024 20:45:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4150939#M164939</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-09-14T20:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4151004#M164948</link>
      <description>&lt;P&gt;Its related to the issue in this thread.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Sep 2024 00:13:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4151004#M164948</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-09-15T00:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4153416#M165074</link>
      <description>&lt;P&gt;Now now don't you two fight over my question ;). These are excellent solutions.&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;&amp;nbsp; I was wondering if you could explain how your solution works in more detail. I'm trying to learn more Dax.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 00:46:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4153416#M165074</guid>
      <dc:creator>jswartz_09</dc:creator>
      <dc:date>2024-09-17T00:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dax filter of all rows based on max value - SQL equivalent</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4231211#M167355</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="793481" data-lia-user-login="jswartz_09" class="lia-mention lia-mention-user"&gt;jswartz_09&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a good day.&amp;nbsp;Has your problem been solved?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wearsky&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 06:12:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-filter-of-all-rows-based-on-max-value-SQL-equivalent/m-p/4231211#M167355</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-10-07T06:12:31Z</dc:date>
    </item>
  </channel>
</rss>

