<?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: Using GROUPBY with dynamic filter context in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/816049#M5403</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, you have to use the column name only, without the table name:&lt;/P&gt;
&lt;P&gt;SUMX( Group_Max; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;[Max volume]&lt;/STRONG&gt; &lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider giving kudos if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2019 16:54:00 GMT</pubDate>
    <dc:creator>AlB</dc:creator>
    <dc:date>2019-10-11T16:54:00Z</dc:date>
    <item>
      <title>Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/806954#M5029</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling with the GROUPBY() function. I would like to group my data by ITEM and doing an average on the volume. The table is filtered by a slicer on the minimum date. It seems like the GROUPBY function is not considering the filter context as the average volume is the same with or without the date slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;ITEM | DATE | VOLUME&lt;/P&gt;&lt;P&gt;A; 01/01/2013; 50&lt;/P&gt;&lt;P&gt;A; 05/01/2013; 60&lt;/P&gt;&lt;P&gt;A; 05/01/2015; 70&lt;/P&gt;&lt;P&gt;B; 01/01/2013; 50&lt;/P&gt;&lt;P&gt;B; 06/02/2013; 50&lt;/P&gt;&lt;P&gt;B; 05/03/2015; 40&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I'm using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=GROUPBY(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Table;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Table[ITEM];&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"Average volume by item";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AVERAGEX(&lt;BR /&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; &amp;nbsp; &amp;nbsp; &amp;nbsp;CURRENTGROUP();&lt;BR /&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; Table[Volume]&lt;BR /&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; &amp;nbsp; &amp;nbsp; &amp;nbsp;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;I would like the GROUPBY() to group the table already filtered with the date slicer, for example Date &amp;gt; 01/01/2017.&lt;/P&gt;&lt;P&gt;I should end up with this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ITEM | AVG VOLUME&lt;/P&gt;&lt;P&gt;A; 70&lt;/P&gt;&lt;P&gt;B; 40&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's not the case and it seems like GROUPBY&amp;nbsp; is ignoring the filter context.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would be the right way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&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; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 13:37:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/806954#M5029</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T13:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807079#M5039</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to be creating a calculated table. That is static and will not be affected by filter context at all. Try creating a table visual instead, with the appropriate measure&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider giving kudos if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 15:43:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807079#M5039</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-10-01T15:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807115#M5041</link>
      <description>&lt;P&gt;Hi AIB, thanks for you help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is their a function I could use in this measure instead of GROUPBY to average on the same "ITEM"?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 16:23:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807115#M5041</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T16:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807160#M5044</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about you just&lt;/P&gt;
&lt;P&gt;1. Place Table[ITEM] in the rows of a matrix visual&lt;/P&gt;
&lt;P&gt;2. Place&amp;nbsp;this simple measure in the visual&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Measure =&amp;nbsp;
AVERAGE( Table[Volume] )&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Use a slicer for the date&lt;/P&gt;
&lt;P&gt;Wouldn't that yield what you're looking far or am I completely misunderstanding?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider giving kudos if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 17:44:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807160#M5044</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-10-01T17:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807239#M5046</link>
      <description>Ok I get what you mean now but I need a table as an output. I'm doing further calculations based on this groupby table.</description>
      <pubDate>Tue, 01 Oct 2019 19:45:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807239#M5046</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-01T19:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807240#M5047</link>
      <description>&lt;P&gt;You can create a table within a measure that will be affected by&amp;nbsp; filter context&lt;/P&gt;
&lt;P&gt;Measure =&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Var AuxTable_ = //Your code from earlier&amp;nbsp;(GROUPBY)&lt;/P&gt;
&lt;P&gt;RETURN&lt;/P&gt;
&lt;P&gt;// The rest of the code using that table here&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 19:49:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/807240#M5047</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-10-01T19:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/815740#M5392</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I'm trying to give it a try to your solution and I think that it could do the job but I'm struggling with the syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you recall à created column in the GROUPBY function stocked in the variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR&lt;BR /&gt;Running_date= MAX(Calendar[date])&lt;BR /&gt;VAR&lt;BR /&gt;Filtered_table_to_date= FILTER(Table1; Table1[date]&amp;lt;=Running_date)&lt;BR /&gt;VAR&lt;BR /&gt;Group_Max=&lt;BR /&gt;GROUPBY(&lt;BR /&gt;Filtered_table_to_date;&lt;BR /&gt;Table1[Item];&lt;BR /&gt;"Max volume"; MAXX(CURRENTGROUP(); Table1[Volume]&lt;BR /&gt;RETURN&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;SUMX(Group_Max; Group_Max[Max volume])&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;How it should be written in the SUMX function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 09:59:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/815740#M5392</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-11T09:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/816049#M5403</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, you have to use the column name only, without the table name:&lt;/P&gt;
&lt;P&gt;SUMX( Group_Max; &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;[Max volume]&lt;/STRONG&gt; &lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider giving kudos if posts are helpful.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&amp;nbsp;&lt;IMG src="https://community.fabric.microsoft.com/html/badge_icons/SU18_powerbi_badge.png" border="0" alt="Datanaut" width="64" height="64" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 16:54:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/816049#M5403</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2019-10-11T16:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using GROUPBY with dynamic filter context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/816299#M5410</link>
      <description>Thank you so much, works perfectly!</description>
      <pubDate>Sat, 12 Oct 2019 08:19:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-GROUPBY-with-dynamic-filter-context/m-p/816299#M5410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-12T08:19:39Z</dc:date>
    </item>
  </channel>
</rss>

