<?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 Distinctcount in a column based on the other column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-in-a-column-based-on-the-other-column/m-p/3526107#M135478</link>
    <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;I have a table with these columns below and need to know how many unique employees per qty of hours.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result should be: 3 employees with 189 hours (A, B, C) and 2 employees with 168 hours (D, E).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is already a filtered table (by country). Field "hours" is a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried Distinctcount with filter, countrows, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;</description>
    <pubDate>Thu, 09 Nov 2023 19:04:56 GMT</pubDate>
    <dc:creator>jpaguiar79</dc:creator>
    <dc:date>2023-11-09T19:04:56Z</dc:date>
    <item>
      <title>Distinctcount in a column based on the other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-in-a-column-based-on-the-other-column/m-p/3526107#M135478</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;I have a table with these columns below and need to know how many unique employees per qty of hours.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result should be: 3 employees with 189 hours (A, B, C) and 2 employees with 168 hours (D, E).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is already a filtered table (by country). Field "hours" is a measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried Distinctcount with filter, countrows, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2023 19:04:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-in-a-column-based-on-the-other-column/m-p/3526107#M135478</guid>
      <dc:creator>jpaguiar79</dc:creator>
      <dc:date>2023-11-09T19:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Distinctcount in a column based on the other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-in-a-column-based-on-the-other-column/m-p/3526240#M135488</link>
      <description>&lt;P&gt;Solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_ctmax&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'table1'&lt;/SPAN&gt;&lt;SPAN&gt;[employee]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'table1'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'table1'&lt;/SPAN&gt;&lt;SPAN&gt;[hours]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;189&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;VAR _ctmin = CALCULATE(DISTINCTCOUNT('table1'[employee]),FILTER('table1','table1'[hours] = 168))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;And I put 189 and 168 into another VARs before these sentences to make sure I get max and min.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Nov 2023 20:16:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-in-a-column-based-on-the-other-column/m-p/3526240#M135488</guid>
      <dc:creator>jpaguiar79</dc:creator>
      <dc:date>2023-11-09T20:16:13Z</dc:date>
    </item>
  </channel>
</rss>

