<?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: Loop SUMX and AVERAGEX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Loop-SUMX-and-AVERAGEX/m-p/3434035#M130240</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159408" data-lia-user-login="amaniramahi" class="lia-mention lia-mention-user"&gt;amaniramahi&lt;/a&gt;&amp;nbsp;Seems like the next step would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = 
  VAR __Table = SUMMARIZECOLUMNS(
    AbandonedCallsDetails[CallDate],
    AbandonedCallsDetails[Start of Hour],
    AbandonedCallsDetails[Month],
    "Count",COUNTROWS(AbandonedCallsDetails)
  )
  VAR __Table1 = 
    SUMMARIZE( __Table, [Start of Hour], "Average", AVERAGE( [Count] ) )
RETURN
  __Table1&lt;/LI-CODE&gt;
&lt;P&gt;Then you could base a visual on this table and do a simple SUM on the Average column?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Sep 2023 13:26:48 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2023-09-16T13:26:48Z</dc:date>
    <item>
      <title>Loop SUMX and AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Loop-SUMX-and-AVERAGEX/m-p/3433892#M130230</link>
      <description>&lt;P&gt;I have a table "AbandonedCallsDetails" contains the following columns:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CallerID&lt;/TD&gt;&lt;TD&gt;CallDate&lt;/TD&gt;&lt;TD&gt;&lt;SPAN&gt;Start of Hour&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;Month&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&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;I want to create a column to calculate the sum of monthly averages of the received calls&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First thing is did is to summarizecolumns&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SUMMARIZECOLUMNS(
    AbandonedCallsDetails[CallDate],
    AbandonedCallsDetails[Start of Hour],
    AbandonedCallsDetails[Month],
    "Count",COUNTROWS(AbandonedCallsDetails)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I dont know how to do the remaining steps&lt;/P&gt;&lt;P&gt;I want to calculate the average of calls received in a certain [Start of Hour] per month&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then to sum the averages per [Start of Hour]&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 08:51:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Loop-SUMX-and-AVERAGEX/m-p/3433892#M130230</guid>
      <dc:creator>amaniramahi</dc:creator>
      <dc:date>2023-09-16T08:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loop SUMX and AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Loop-SUMX-and-AVERAGEX/m-p/3434035#M130240</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="159408" data-lia-user-login="amaniramahi" class="lia-mention lia-mention-user"&gt;amaniramahi&lt;/a&gt;&amp;nbsp;Seems like the next step would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Table = 
  VAR __Table = SUMMARIZECOLUMNS(
    AbandonedCallsDetails[CallDate],
    AbandonedCallsDetails[Start of Hour],
    AbandonedCallsDetails[Month],
    "Count",COUNTROWS(AbandonedCallsDetails)
  )
  VAR __Table1 = 
    SUMMARIZE( __Table, [Start of Hour], "Average", AVERAGE( [Count] ) )
RETURN
  __Table1&lt;/LI-CODE&gt;
&lt;P&gt;Then you could base a visual on this table and do a simple SUM on the Average column?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 13:26:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Loop-SUMX-and-AVERAGEX/m-p/3434035#M130240</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2023-09-16T13:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Loop SUMX and AVERAGEX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Loop-SUMX-and-AVERAGEX/m-p/3434536#M130267</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;, some how it didnt work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I tried more complicated code, but at least it worked&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR table1 = 

SUMMARIZE(
    ADDCOLUMNS(
        SUMMARIZE(
            AbandonedCallsDetails,
            AbandonedCallsDetails[CallTime],
            AbandonedCallsDetails[Month],
            "AverageCount",
            VAR CurrentCallTime = AbandonedCallsDetails[CallTime]
            VAR CurrentMonth = AbandonedCallsDetails[Month]
            RETURN
            AVERAGEX(
                FILTER(
                    SUMMARIZE(
                        AbandonedCallsDetails,
                        AbandonedCallsDetails[CallDate],
                        AbandonedCallsDetails[CallTime],
                        AbandonedCallsDetails[Month],
                        "Count", COUNTROWS(AbandonedCallsDetails)
                    ),
                    [CallTime] = CurrentCallTime &amp;amp;&amp;amp; [Month] = CurrentMonth
                ),
                [Count]
            )
        ),
        "SumOfAverages",
        SUMX(
            FILTER(
                SUMMARIZE(
                    AbandonedCallsDetails,
                    AbandonedCallsDetails[CallTime],
                    AbandonedCallsDetails[Month],
                    "AverageCount",
                    VAR CurrentCallTime = AbandonedCallsDetails[CallTime]
                    VAR CurrentMonth = AbandonedCallsDetails[Month]
                    RETURN
                    AVERAGEX(
                        FILTER(
                            SUMMARIZE(
                                AbandonedCallsDetails,
                                AbandonedCallsDetails[CallDate],
                                AbandonedCallsDetails[CallTime],
                                AbandonedCallsDetails[Month],
                                "Count", COUNTROWS(AbandonedCallsDetails)
                            ),
                            [CallTime] = CurrentCallTime &amp;amp;&amp;amp; [Month] = CurrentMonth
                        ),
                        [Count]
                    )
                ),
                [CallTime] = EARLIER(AbandonedCallsDetails[CallTime])
            ),
            [AverageCount]
        )
    ),
    AbandonedCallsDetails[CallTime],
    [SumOfAverages]
)

RETURN
    SUMX(table1, [SumOfAverages])
&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 17 Sep 2023 06:25:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Loop-SUMX-and-AVERAGEX/m-p/3434536#M130267</guid>
      <dc:creator>amaniramahi</dc:creator>
      <dc:date>2023-09-17T06:25:52Z</dc:date>
    </item>
  </channel>
</rss>

