<?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 a measure as a filter for another measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1068168#M14956</link>
    <description>&lt;P&gt;You should never attempt such a problem without&amp;nbsp; a dimension table on the site.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = SUMX(VALUES(UniqueSites[Site]),if([Site Size Cumulative] &amp;gt;0,1,0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Note the new dimenstion table called UniqueSites&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/s/bteziytyavesd33/site%20size.pbix?dl=1" target="_blank"&gt;https://www.dropbox.com/s/bteziytyavesd33/site%20size.pbix?dl=1&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 05 May 2020 01:57:07 GMT</pubDate>
    <dc:creator>MattAllington</dc:creator>
    <dc:date>2020-05-05T01:57:07Z</dc:date>
    <item>
      <title>Using a measure as a filter for another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1054545#M14501</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the example below, I'm trying to create a measure to count the number of SiteRefs where the cumulative value of size is greater than 0:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;So the correct answer would be 4 for January, 3 for February, 2 for March and so on. I have a date table and have created measures for site size and cumulative site size (below), and am trying to create a third calculated count measure using cumulative site size &amp;gt; 0 as a filter, but keep getting an error (cannot use values of tru/false). Can anyone help?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Site Size = SUM(Sites[Size])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Site Cumulative Size = CALCULATE([Site Size],FILTER(ALL('Date'),'Date'[Date] &amp;lt;= MAX('Date'[Date])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SiteRefEventDateSize&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;01 January 2020&lt;/TD&gt;&lt;TD&gt;10000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;01 January 2020&lt;/TD&gt;&lt;TD&gt;4500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;15 January 2020&lt;/TD&gt;&lt;TD&gt;-5000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;15 January 2020&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;15 January 2020&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;15 January 2020&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;15 February 2020&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;15 February 2020&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;15 February 2020&lt;/TD&gt;&lt;TD&gt;-500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;15 February 2020&lt;/TD&gt;&lt;TD&gt;-1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;15 February 2020&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;15 March 2020&lt;/TD&gt;&lt;TD&gt;-7000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;15 March 2020&lt;/TD&gt;&lt;TD&gt;600&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;15 April 2020&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;F&lt;/TD&gt;&lt;TD&gt;15 May 2020&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 19:29:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1054545#M14501</guid>
      <dc:creator>qp_andy</dc:creator>
      <dc:date>2020-04-28T19:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a filter for another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1054596#M14506</link>
      <description>Not sure I am 100% understanding but typically you would do something along the lines of:&lt;BR /&gt;&lt;BR /&gt;VAR __Table = 'Table' //current table rows in context&lt;BR /&gt;VAR __Table1 = ADDCOLUMNS(__Table,"Measure",[Some measure])&lt;BR /&gt;RETURN&lt;BR /&gt;COUNTX(FILTER(__Table1,[Measure] &amp;gt; 0),[Column])&lt;BR /&gt;&lt;BR /&gt;Something along those lines, sometimes you need to do a SUMMARIZE for your initial table.</description>
      <pubDate>Tue, 28 Apr 2020 19:46:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1054596#M14506</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-04-28T19:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a filter for another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1054720#M14516</link>
      <description>&lt;P&gt;Thanks Greg. Sorry probably wasn't 100% clear. The matrix in the original post shows the cumulative values by month for each SiteRef. What I am trying to do is come up with a way to count the number of SiteRefs in each month that have a cumulative size greater than zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure what you are referring to by [column] in your reply?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 21:24:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1054720#M14516</guid>
      <dc:creator>qp_andy</dc:creator>
      <dc:date>2020-04-28T21:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a filter for another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1055847#M14551</link>
      <description>&lt;P&gt;&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;following your advice I've got part of the way there! I've created a measure which works without context....what I cannot work out is why an error is produced when context is added&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Sites" href="https://www.dropbox.com/s/tzbm3k0n52rvf3f/Sites.pbix?dl=0" target="_blank" rel="noopener"&gt;Sites&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 09:02:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1055847#M14551</guid>
      <dc:creator>qp_andy</dc:creator>
      <dc:date>2020-04-29T09:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a filter for another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1066050#M14890</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="217" data-lia-user-login="MattAllington" class="lia-mention lia-mention-user"&gt;MattAllington&lt;/a&gt;any ideas? I thought this would be simple to solve although its proving much more difficult than I thought&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2020 09:15:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1066050#M14890</guid>
      <dc:creator>qp_andy</dc:creator>
      <dc:date>2020-05-04T09:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a filter for another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1068168#M14956</link>
      <description>&lt;P&gt;You should never attempt such a problem without&amp;nbsp; a dimension table on the site.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = SUMX(VALUES(UniqueSites[Site]),if([Site Size Cumulative] &amp;gt;0,1,0))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Note the new dimenstion table called UniqueSites&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/s/bteziytyavesd33/site%20size.pbix?dl=1" target="_blank"&gt;https://www.dropbox.com/s/bteziytyavesd33/site%20size.pbix?dl=1&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 05 May 2020 01:57:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1068168#M14956</guid>
      <dc:creator>MattAllington</dc:creator>
      <dc:date>2020-05-05T01:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using a measure as a filter for another measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1068281#M14961</link>
      <description>&lt;P&gt;Fantastic&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="217" data-lia-user-login="MattAllington" class="lia-mention lia-mention-user"&gt;MattAllington&lt;/a&gt; this is perfect, exactly what I needed! Thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 02:35:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-a-measure-as-a-filter-for-another-measure/m-p/1068281#M14961</guid>
      <dc:creator>qp_andy</dc:creator>
      <dc:date>2020-05-05T02:35:24Z</dc:date>
    </item>
  </channel>
</rss>

