<?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 Summarize with ALL in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-with-ALL/m-p/3077957#M107087</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following function:&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;YEAR | MAX =
VAR vals = 
                SUMMARIZE(
                 'Date' ,
                 'Date'[Year],
                 "myMeasure", CALCULATE([Prod | Max | AllY],  ALL('Date'))
               )
    VAR measureMax = MAXX(vals, [myMeasure])
    VAR y_value = calculate(MAXX(FILTER(vals, [myMeasure] = measureMax), 'Date'[Year]))
RETURN
    y_value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure [Prod | Max | AllY] is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;calculate(MAXX(BD,BD[Production]), ALL('Date'[Year]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both tables (BD and Date) are connected via Date[Date] -&amp;gt; BD[Date] in a 1-to-many relationship both directions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the var &lt;EM&gt;measureMax&lt;/EM&gt; and its working properly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The var &lt;EM&gt;y_value&lt;/EM&gt; is however, wrong! Its returning the year as if the ALL function wasn't there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried different approaches (like addcolumns and so on) but with no success.&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2023 14:57:11 GMT</pubDate>
    <dc:creator>Kebas_Leech</dc:creator>
    <dc:date>2023-02-13T14:57:11Z</dc:date>
    <item>
      <title>Summarize with ALL</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-with-ALL/m-p/3077957#M107087</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following function:&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;YEAR | MAX =
VAR vals = 
                SUMMARIZE(
                 'Date' ,
                 'Date'[Year],
                 "myMeasure", CALCULATE([Prod | Max | AllY],  ALL('Date'))
               )
    VAR measureMax = MAXX(vals, [myMeasure])
    VAR y_value = calculate(MAXX(FILTER(vals, [myMeasure] = measureMax), 'Date'[Year]))
RETURN
    y_value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure [Prod | Max | AllY] is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;calculate(MAXX(BD,BD[Production]), ALL('Date'[Year]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both tables (BD and Date) are connected via Date[Date] -&amp;gt; BD[Date] in a 1-to-many relationship both directions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked the var &lt;EM&gt;measureMax&lt;/EM&gt; and its working properly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The var &lt;EM&gt;y_value&lt;/EM&gt; is however, wrong! Its returning the year as if the ALL function wasn't there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried different approaches (like addcolumns and so on) but with no success.&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 14:57:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-with-ALL/m-p/3077957#M107087</guid>
      <dc:creator>Kebas_Leech</dc:creator>
      <dc:date>2023-02-13T14:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize with ALL</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-with-ALL/m-p/3086536#M107935</link>
      <description>&lt;P&gt;Solution was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;VAR MaxValue = calculate([Prod | Max | AllY], ALL('Date'[Year]))
RETURN
    CALCULATE(
        MAX('Date'[Year]),
        FILTER(
            ALL('Date'[Year]),
            [Prod | Max | AllY] = MaxValue
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Feb 2023 13:41:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-with-ALL/m-p/3086536#M107935</guid>
      <dc:creator>Kebas_Leech</dc:creator>
      <dc:date>2023-02-19T13:41:58Z</dc:date>
    </item>
  </channel>
</rss>

