<?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: ID Count with filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092174#M108362</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sounds simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to visualize this in any of the P BI visual, simply DISTINCTCOUNT of IDs should work. You just need to put the column that you want to split the results by onto the visualization. The filter context will do the rest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to create separate visuals, each for each type, you can either use filters on the filter pane or add a filter argument to the `CALCULATE` function. In the first case, DISTINCTCOUNT measure would work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the measure that use the expression for filtering, go for this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measreu 1 = 
CALCULATE(
    DISTINCTCOUNT( Data[ID] ),
    Data[Type] = 1
)

Measreu 2 = 
CALCULATE(
    DISTINCTCOUNT( Data[ID] ),
    Data[Type] = 2
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I assume there is no need to create a separate measures for your case. Create a DISTINCTCOUNT measure and put it on the visualization along with the [Type] column (or any other column that you want to display with the measure).&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2023 07:15:26 GMT</pubDate>
    <dc:creator>intruder</dc:creator>
    <dc:date>2023-02-22T07:15:26Z</dc:date>
    <item>
      <title>ID Count with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092117#M108358</link>
      <description>&lt;P&gt;I've got the date as shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Table&lt;/TD&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;564080&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;648747&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;701842&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;701858&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;701859&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;701860&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;760287&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;760304&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;760371&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;760394&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;760397&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;760400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;760514&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I nees to get tow measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1-The Distinct count of IDs where table field equals 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2-The Distinct count of IDs where table field equals 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tryed:&lt;/P&gt;&lt;P&gt;Measure = CALCULATE(&lt;BR /&gt;DISTINCTCOUNT(data[ID]),FILTER(data,data[ID]="2"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the count is not correct&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 06:52:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092117#M108358</guid>
      <dc:creator>marcss</dc:creator>
      <dc:date>2023-02-22T06:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: ID Count with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092174#M108362</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sounds simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to visualize this in any of the P BI visual, simply DISTINCTCOUNT of IDs should work. You just need to put the column that you want to split the results by onto the visualization. The filter context will do the rest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to create separate visuals, each for each type, you can either use filters on the filter pane or add a filter argument to the `CALCULATE` function. In the first case, DISTINCTCOUNT measure would work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the measure that use the expression for filtering, go for this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measreu 1 = 
CALCULATE(
    DISTINCTCOUNT( Data[ID] ),
    Data[Type] = 1
)

Measreu 2 = 
CALCULATE(
    DISTINCTCOUNT( Data[ID] ),
    Data[Type] = 2
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I assume there is no need to create a separate measures for your case. Create a DISTINCTCOUNT measure and put it on the visualization along with the [Type] column (or any other column that you want to display with the measure).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 07:15:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092174#M108362</guid>
      <dc:creator>intruder</dc:creator>
      <dc:date>2023-02-22T07:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: ID Count with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092199#M108364</link>
      <description>&lt;P&gt;It doesn't work, both measures show the same value:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 07:25:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092199#M108364</guid>
      <dc:creator>marcss</dc:creator>
      <dc:date>2023-02-22T07:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: ID Count with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092225#M108368</link>
      <description>&lt;P&gt;hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="518756" data-lia-user-login="marcss" class="lia-mention lia-mention-user"&gt;marcss&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try like:&lt;/P&gt;&lt;DIV&gt;count1 =&lt;/DIV&gt;&lt;DIV&gt;COUTROWS(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; CALCULATETABLE(&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VALUES(data[ID]),&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data[Table]=1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Feb 2023 07:44:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092225#M108368</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2023-02-22T07:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: ID Count with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092237#M108371</link>
      <description>&lt;P&gt;Try then:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 1 = 
CALCULATE(
    DISTINCTCOUNT( Data[ID] ),
    REMOVEFILTERS( Data ),
    Data[Type] = 1
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Feb 2023 07:54:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ID-Count-with-filter/m-p/3092237#M108371</guid>
      <dc:creator>intruder</dc:creator>
      <dc:date>2023-02-22T07:54:00Z</dc:date>
    </item>
  </channel>
</rss>

