<?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 Filter SUMMARIZECOLUMNS based on separate measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-SUMMARIZECOLUMNS-based-on-separate-measure/m-p/1047548#M14198</link>
    <description>&lt;P&gt;I'm hoping to get some guidance of improving a Report Builder dataset query to reduce the number of rows returned.&amp;nbsp; At the moment, I'm returning close to 40,000 rows, but ultimately only 18,000 rows would be included in the final report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset is a star schema with 4 dimension tables and 1 fact table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generically, the query DAX is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EVALUATE&lt;BR /&gt;SUMMARIZECOLUMNS (&lt;BR /&gt;'DIM_TABLE_1'[CATEGORY_A],&lt;BR /&gt;'DIM_TABLE_2'[CATEGORY_B],&lt;BR /&gt;'DIM_TABLE_3'[CATEGORY_C],&lt;BR /&gt;'DIM_TABLE_4'[CATEGORY_D],&lt;BR /&gt;FILTERCONDITION_1,&lt;BR /&gt;FILTERCONDITION_2,&lt;BR /&gt;FACT_MEASURE_1,&lt;BR /&gt;FACT_MEASURE_2&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, there's a combination of the first 3 categories (from 3 separate dimension tables) that needs to be filtered out based on a separate measure (call it FACT_MEASURE_3 &amp;gt; 0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I imagine I could include that measure in the original DAX query, but I'm not clear how to construct that filter condition and how it fits into the query.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help with the structure of the query or related resources would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2020 16:53:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-04-24T16:53:51Z</dc:date>
    <item>
      <title>Filter SUMMARIZECOLUMNS based on separate measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-SUMMARIZECOLUMNS-based-on-separate-measure/m-p/1047548#M14198</link>
      <description>&lt;P&gt;I'm hoping to get some guidance of improving a Report Builder dataset query to reduce the number of rows returned.&amp;nbsp; At the moment, I'm returning close to 40,000 rows, but ultimately only 18,000 rows would be included in the final report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset is a star schema with 4 dimension tables and 1 fact table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generically, the query DAX is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EVALUATE&lt;BR /&gt;SUMMARIZECOLUMNS (&lt;BR /&gt;'DIM_TABLE_1'[CATEGORY_A],&lt;BR /&gt;'DIM_TABLE_2'[CATEGORY_B],&lt;BR /&gt;'DIM_TABLE_3'[CATEGORY_C],&lt;BR /&gt;'DIM_TABLE_4'[CATEGORY_D],&lt;BR /&gt;FILTERCONDITION_1,&lt;BR /&gt;FILTERCONDITION_2,&lt;BR /&gt;FACT_MEASURE_1,&lt;BR /&gt;FACT_MEASURE_2&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, there's a combination of the first 3 categories (from 3 separate dimension tables) that needs to be filtered out based on a separate measure (call it FACT_MEASURE_3 &amp;gt; 0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I imagine I could include that measure in the original DAX query, but I'm not clear how to construct that filter condition and how it fits into the query.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help with the structure of the query or related resources would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 16:53:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-SUMMARIZECOLUMNS-based-on-separate-measure/m-p/1047548#M14198</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-24T16:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filter SUMMARIZECOLUMNS based on separate measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-SUMMARIZECOLUMNS-based-on-separate-measure/m-p/1047707#M14207</link>
      <description>&lt;P&gt;you can do something like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;EVALUATE
FILTER(
SUMMARIZECOLUMNS (
'DIM_TABLE_1'[CATEGORY_A],
'DIM_TABLE_2'[CATEGORY_B],
'DIM_TABLE_3'[CATEGORY_C],
'DIM_TABLE_4'[CATEGORY_D],
FILTERCONDITION_1,
FILTERCONDITION_2,
FACT_MEASURE_1,
FACT_MEASURE_2,
FACT_MEASURE_3,
)
FACT_MEASURE_3&amp;gt;0
)&lt;/LI-CODE&gt;
&lt;P&gt;would that work for you?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data, I could be more specific. Like this (just copy and paste into the post window).&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Column1&lt;/TD&gt;
&lt;TD&gt;Column2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;2.5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 19:01:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-SUMMARIZECOLUMNS-based-on-separate-measure/m-p/1047707#M14207</guid>
      <dc:creator>Stachu</dc:creator>
      <dc:date>2020-04-24T19:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filter SUMMARIZECOLUMNS based on separate measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-SUMMARIZECOLUMNS-based-on-separate-measure/m-p/1047920#M14223</link>
      <description>&lt;P&gt;Depending on the semantics of your query... you could try the following:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;EVALUATE
CALCULATETABLE(
	SUMMARIZECOLUMNS (
		'DIM_TABLE_1'[CATEGORY_A],
		'DIM_TABLE_2'[CATEGORY_B],
		'DIM_TABLE_3'[CATEGORY_C],
		'DIM_TABLE_4'[CATEGORY_D],
		FILTERCONDITION_1,
		FILTERCONDITION_2,
		FACT_MEASURE_1,
		FACT_MEASURE_2
	),
	FILTER(
		SUMMARIZE(
			FactTable,
			'DIM_TABLE_1'[CATEGORY_A],
			'DIM_TABLE_2'[CATEGORY_B],
			'DIM_TABLE_3'[CATEGORY_C]	
		),
		[FACT_MEASURE_3] &amp;gt; 0
	)
)

// 2. version, could be faster

CALCULATETABLE(
	SUMMARIZECOLUMNS (
		'DIM_TABLE_1'[CATEGORY_A],
		'DIM_TABLE_2'[CATEGORY_B],
		'DIM_TABLE_3'[CATEGORY_C],
		'DIM_TABLE_4'[CATEGORY_D],
		FILTERCONDITION_1,
		FILTERCONDITION_2,
		FACT_MEASURE_1,
		FACT_MEASURE_2
	),
	FILTER(
		CROSSJOIN(
			VALUES( 'DIM_TABLE_1'[CATEGORY_A] ),
			values( 'DIM_TABLE_2'[CATEGORY_B] ),
			VALUES( 'DIM_TABLE_3'[CATEGORY_C] )
		),
		[FACT_MEASURE_3] &amp;gt; 0
	)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 22:22:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-SUMMARIZECOLUMNS-based-on-separate-measure/m-p/1047920#M14223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-04-24T22:22:19Z</dc:date>
    </item>
  </channel>
</rss>

