<?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 of a summarize in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1517158#M29549</link>
    <description>&lt;P&gt;Hi.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am struggling with this formula. A user can have several evaluations during a year. So I need to calculate the monthly average, and then average those monthly averages.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am trying to summarize another summarize, but I can't get to the "MonthlyAverage" that contains the average for each month.&lt;BR /&gt;&lt;BR /&gt;Any tips on how to fix it? They will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Armando&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMMARIZE(
    SUMMARIZE (
        'PositionEvaluationPeriod',
        Calendar[Date],        
        Users[idUser],
        "MonthlyAverage", AVERAGE ( Evaluation[Grade] )
    ),
    Users[idUser],
    "GeneralAverage", AVERAGE(MonthlyAverage)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Nov 2020 18:54:13 GMT</pubDate>
    <dc:creator>alfranco17</dc:creator>
    <dc:date>2020-11-25T18:54:13Z</dc:date>
    <item>
      <title>Summarize of a summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1517158#M29549</link>
      <description>&lt;P&gt;Hi.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am struggling with this formula. A user can have several evaluations during a year. So I need to calculate the monthly average, and then average those monthly averages.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am trying to summarize another summarize, but I can't get to the "MonthlyAverage" that contains the average for each month.&lt;BR /&gt;&lt;BR /&gt;Any tips on how to fix it? They will be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Armando&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMMARIZE(
    SUMMARIZE (
        'PositionEvaluationPeriod',
        Calendar[Date],        
        Users[idUser],
        "MonthlyAverage", AVERAGE ( Evaluation[Grade] )
    ),
    Users[idUser],
    "GeneralAverage", AVERAGE(MonthlyAverage)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 18:54:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1517158#M29549</guid>
      <dc:creator>alfranco17</dc:creator>
      <dc:date>2020-11-25T18:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize of a summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1517172#M29550</link>
      <description>&lt;P&gt;Try this.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Test =
SUMMARIZE(
    SUMMARIZE(
        'PositionEvaluationPeriod',
        Calendar[Date],
        Users[idUser],
        "MonthlyAverage", AVERAGE( Evaluation[Grade] )
    ),
    Users[idUser],
    "GeneralAverage", AVERAGE( [MonthlyAverage] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;The syntax is correct, but do not think it will work. You will probably need this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Test =
VAR varFirstSummary =
    SUMMARIZE(
        'PositionEvaluationPeriod',
        Calendar[Date],
        Users[idUser],
        "MonthlyAverage", AVERAGE( Evaluation[Grade] )
    )
RETURN
    SUMMARIZE(
        varFirstSummary,
        Users[idUser],
        "GeneralAverage",
            AVERAGEX(
                varFirstSummary,
                [MonthlyAverage]
            )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;And you may still need to wrap AverageX in a CALCULATE, and you might still get wrong results. SUMMARIZE should generally only be used to create the summary fields. Use ADDCOLUMNS() to add the values.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Test =
VAR varFirstSummary =
    ADDCOLUMNS(
        SUMMARIZE(
            'PositionEvaluationPeriod',
            Calendar[Date],
            Users[idUser]
        ),
        "MonthlyAverage",
            CALCULATE(
                AVERAGE( Evaluation[Grade] )
            )
    )
RETURN
    ADDCOLUMNS(
        SUMMARIZE(
            varFirstSummary,
            Users[idUser]
        ),
        "GeneralAverage",
            CALCULATE(
                AVERAGEX(
                    varFirstSummary,
                    [MonthlyAverage]
                )
            )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;See&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/best-practices-using-summarize-and-addcolumns/" target="_blank"&gt;Best Practices Using SUMMARIZE and ADDCOLUMNS - SQLBI&lt;/A&gt;&amp;nbsp;for more info on this. SUMMARIZE() is a bit buggy in some cases is the reason for this.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 19:16:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1517172#M29550</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-11-25T19:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize of a summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1519607#M29612</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 02:10:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1519607#M29612</guid>
      <dc:creator>alfranco17</dc:creator>
      <dc:date>2020-11-27T02:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize of a summarize</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1521275#M29656</link>
      <description>&lt;P&gt;Glad to help&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="114209" data-lia-user-login="alfranco17" class="lia-mention lia-mention-user"&gt;alfranco17&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 16:40:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Summarize-of-a-summarize/m-p/1521275#M29656</guid>
      <dc:creator>edhans</dc:creator>
      <dc:date>2020-11-27T16:40:04Z</dc:date>
    </item>
  </channel>
</rss>

