<?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: DAX: Distinct count with multiple filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2056158#M46327</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&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;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks but it's still not working out for me. Could easily be the fact that I'm new but the tables are different.&lt;/P&gt;&lt;P&gt;So I have a "Calendar" table where I want the year to be 2021.&lt;/P&gt;&lt;P&gt;Than I have a measure 'Sales (kg)' that I want to be &amp;gt; 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Lenn&lt;/P&gt;</description>
    <pubDate>Fri, 03 Sep 2021 10:13:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-03T10:13:32Z</dc:date>
    <item>
      <title>DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2048777#M46042</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm quite new to DAX and I don't seem to get a good formula for the below calculation.&lt;/P&gt;&lt;P&gt;I have many products that were sold over the years.&lt;/P&gt;&lt;P&gt;Now, I want to distinct count the products that were sold &amp;gt; 50 in the year 2021&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this but didn't work:&lt;/P&gt;&lt;P&gt;=IF(CALCULATE([Volume];'Calendar'[Year]=2021)&amp;gt;50;DISTINCTCOUNT([Product]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you help out? Many thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 11:58:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2048777#M46042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-31T11:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2048795#M46044</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Perhaps try COUNTROWS(DISTINCT(FILTER('Table',&amp;lt;filters go here&amp;gt;)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is not helpful.&amp;nbsp;Sorry, having trouble following, can you post sample data as text and expected output?&lt;BR /&gt;Not really enough information to go on, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 12:05:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2048795#M46044</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-08-31T12:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2048846#M46046</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Distinct_Vol&amp;gt;50_Year2021 =
CALCULATE (
    DISTINCTCOUNT ( Sales[Product] ),
    'Calendar'[Year] = 2021,
    Sales[Volume] &amp;gt; 50
)&lt;/LI-CODE&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 12:18:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2048846#M46046</guid>
      <dc:creator>Jos_Woolley</dc:creator>
      <dc:date>2021-08-31T12:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2050781#M46118</link>
      <description>&lt;P&gt;Thanks Jos, however this is not working, please find more info on figure below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 08:06:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2050781#M46118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-01T08:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2050784#M46119</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&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;&lt;/P&gt;&lt;P&gt;Please find a figure below to help, the yellow cell "4" is what I aim to get:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 08:07:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2050784#M46119</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-01T08:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2050911#M46122</link>
      <description>&lt;P&gt;Works fine for me. Perhaps share your file.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 08:54:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2050911#M46122</guid>
      <dc:creator>Jos_Woolley</dc:creator>
      <dc:date>2021-09-01T08:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2050965#M46123</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Try this measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = 
COUNTROWS (
    DISTINCT (
        FILTER (
            FILTER ( 'Table', YEAR ( 'Table'[Date] ) = 2021 ),
            'Table'[Sales (KG)] &amp;gt; 50
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;SPAN&gt;f this post&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;SPAN&gt;, then please consider&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Accept it as the solution&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Appreciate your Kudos&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;img /&gt;&lt;STRONG&gt;&amp;nbsp;!!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 09:06:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2050965#M46123</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-09-01T09:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2051213#M46137</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Yep,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;'s solution was the route I was thinking about, COUNTROWS(DISTINCT(FILTER. Could also be written:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
  COUNTROWS
    DISTINCT(
      SELECTCOLUMNS(
        FILTER( 'Table', YEAR( 'Table'[Date]) = 2021 &amp;amp;&amp;amp; [Sales (kg)] &amp;gt; 50),
        "__Product",[Product]
      )
    )
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The difference is that you are returning distinct products in the above measure versus distinct table rows. Not sure if that matters or not.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 10:51:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2051213#M46137</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-09-01T10:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2056158#M46327</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&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;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks but it's still not working out for me. Could easily be the fact that I'm new but the tables are different.&lt;/P&gt;&lt;P&gt;So I have a "Calendar" table where I want the year to be 2021.&lt;/P&gt;&lt;P&gt;Than I have a measure 'Sales (kg)' that I want to be &amp;gt; 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Lenn&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 10:13:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2056158#M46327</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-03T10:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2056160#M46328</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks but it's still not working out for me. Could easily be the fact that I'm new but the tables are different.&lt;/P&gt;&lt;P&gt;So I have a "Calendar" table where I want the year to be 2021.&lt;/P&gt;&lt;P&gt;Than I have a measure 'Sales (kg)' that I want to be &amp;gt; 50&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Lenn&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2021 10:16:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2056160#M46328</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-03T10:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2057235#M46370</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ii it possible to share sample of your table(s) here? not as a screenshot&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Or can you share your PBIX file here?(Dropbod, gofile.io, google drive)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Appreciate your Kudos&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":victory_hand:"&gt;✌️&lt;/span&gt; !!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 03:35:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2057235#M46370</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-09-04T03:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX: Distinct count with multiple filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2330815#M58564</link>
      <description>&lt;P&gt;Great simple &amp;amp; elegant solution. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 12:12:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Distinct-count-with-multiple-filters/m-p/2330815#M58564</guid>
      <dc:creator>Peppermint_T</dc:creator>
      <dc:date>2022-02-10T12:12:43Z</dc:date>
    </item>
  </channel>
</rss>

