<?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: Filter with count function within a measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314739#M124002</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="436230" data-lia-user-login="MonK" class="lia-mention lia-mention-user"&gt;MonK&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What (I think) you have to do is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
    CALCULATE(
        DISTINCTCOUNT( 'Table'[ID] ),
        FILTER(
            ADDCOLUMNS(
                SUMMARIZE(
                'Table',
                'Table'[type],
                'Table'[ID]
                ),
                "count ID", CALCULATE( COUNT( 'Table'[ID] ) )
            ),
            [count ID] &amp;gt; 1
        ),
        Table[type] = "abc",
        Datediff(Table[Date1], Table[Date2]) &amp;lt;= 'What-If'[Value]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this works.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jul 2023 15:02:41 GMT</pubDate>
    <dc:creator>Alf94</dc:creator>
    <dc:date>2023-07-04T15:02:41Z</dc:date>
    <item>
      <title>Filter with count function within a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314301#M123959</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a table with the following columns, among some other columns:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now I need a measure that will count the number of distinct IDs that occur more than 1x when filtered by a particular type. I want to ignore all the ones that appear only once here. Additionally, a Datediff function is to be added as a filter, but that had worked.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried this combination, but the red line unfortunately gave an error message:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Calculate(distinctcount(table[ID]),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Filter(table,&lt;/SPAN&gt;&lt;SPAN&gt; table[Type] = "abc"),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Filter(table,Datediff(Table[Date1],Table[Date2] &amp;lt;= 'What-if'[Value],&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;Filter(countx(ID) &amp;gt; 1))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone help me here? Probably it's very easy, but I could not find a solution.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;thanks a lot&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 10:58:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314301#M123959</guid>
      <dc:creator>MonK</dc:creator>
      <dc:date>2023-07-04T10:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filter with count function within a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314497#M123974</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="436230" data-lia-user-login="MonK" class="lia-mention lia-mention-user"&gt;MonK&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try the following?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
    CALCULATE(
        DISTINCTCOUNT( 'Table'[ID] ),
        FILTER(
            ADDCOLUMNS(
                SUMMARIZE(
                'Table',
                'Table'[type],
                'Table'[ID]
                ),
                "count ID", CALCULATE( COUNT( 'Table'[ID] ) )
            ),
            [count ID] &amp;gt; 1
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can add as filters the type you want to consider and your datediff function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I answered your question, please mark my post as a solution.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 12:55:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314497#M123974</guid>
      <dc:creator>Alf94</dc:creator>
      <dc:date>2023-07-04T12:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filter with count function within a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314731#M123999</link>
      <description>&lt;P&gt;thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the measure and used my filters after this:&lt;/P&gt;&lt;PRE&gt; "count ID", CALCULATE( COUNT( 'Table'[ID] ) )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;is this correct in this place before the last ")"? than I got the result as it would be with all Ids, not with the &amp;gt;1.&lt;/P&gt;&lt;PRE&gt;[count ID] &amp;gt; 1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Do you have an idea here? thank you very much for your efforts &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460119" data-lia-user-login="Alf94" class="lia-mention lia-mention-user"&gt;Alf94&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 14:56:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314731#M123999</guid>
      <dc:creator>MonK</dc:creator>
      <dc:date>2023-07-04T14:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filter with count function within a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314739#M124002</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="436230" data-lia-user-login="MonK" class="lia-mention lia-mention-user"&gt;MonK&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What (I think) you have to do is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
    CALCULATE(
        DISTINCTCOUNT( 'Table'[ID] ),
        FILTER(
            ADDCOLUMNS(
                SUMMARIZE(
                'Table',
                'Table'[type],
                'Table'[ID]
                ),
                "count ID", CALCULATE( COUNT( 'Table'[ID] ) )
            ),
            [count ID] &amp;gt; 1
        ),
        Table[type] = "abc",
        Datediff(Table[Date1], Table[Date2]) &amp;lt;= 'What-If'[Value]
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this works.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 15:02:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3314739#M124002</guid>
      <dc:creator>Alf94</dc:creator>
      <dc:date>2023-07-04T15:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filter with count function within a measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3316780#M124110</link>
      <description>&lt;P&gt;thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 16:49:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-with-count-function-within-a-measure/m-p/3316780#M124110</guid>
      <dc:creator>MonK</dc:creator>
      <dc:date>2023-07-05T16:49:15Z</dc:date>
    </item>
  </channel>
</rss>

