<?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: DISTINCTCOUNT of Rows filtered by other column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3434052#M130243</link>
    <description>&lt;P&gt;I don't know what you're trying to calculate. Your example contains more columns. You need to provide a correct demo with the expected result.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Sep 2023 14:01:40 GMT</pubDate>
    <dc:creator>ERD</dc:creator>
    <dc:date>2023-09-16T14:01:40Z</dc:date>
    <item>
      <title>DISTINCTCOUNT of Rows filtered by other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3431863#M130113</link>
      <description>&lt;P&gt;Trying to create a measure to use in a card.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Field&lt;/TD&gt;&lt;TD&gt;Time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0&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;Distinctcount of row (Field) has to be filtered and not counted if it contains a time value of &amp;lt;0.&lt;/P&gt;&lt;P&gt;Trying to get an outcome like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Sum of Distinct field with out negative t&lt;/P&gt;&lt;P&gt;ime time value&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still new to PowerBI an DAX. Any help is appreciated! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 22:43:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3431863#M130113</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-14T22:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT of Rows filtered by other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3432149#M130132</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've prepared your required output, but the answer is not 2 but is 3 as shown below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I attach the link to the pbix file below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!AlqFfzVTqicpnh0Y-yIVtTsoFKpG?e=l1kqgc" target="_blank"&gt;DISTINCTCOUNT of Rows filtered by other column.pbix&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 02:56:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3432149#M130132</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2023-09-15T02:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT of Rows filtered by other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3432431#M130149</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, you can try this measure:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;dcount =
VAR t =
    FILTER (
        ADDCOLUMNS (
            VALUES ( 'Table'[Field] ),
            "minv",
                VAR current_field = CALCULATE ( SELECTEDVALUE ( 'Table'[Field] ) )
                RETURN
                    CALCULATE ( MIN ( 'Table'[Time] ), 'Table'[Field] = current_field )
        ),
        [minv] &amp;gt;= 0
    )
RETURN
    COUNTROWS ( t )&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 06:57:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3432431#M130149</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2023-09-15T06:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT of Rows filtered by other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3433563#M130211</link>
      <description>&lt;P&gt;Hello &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291363" data-lia-user-login="ERD" class="lia-mention lia-mention-user"&gt;ERD&lt;/a&gt;&amp;nbsp;ERD,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This solution does work for what I originally asked, but for my real purpose I need it to fit into a percentage calculation. I see I needed to be more specific, I apologize.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Adjusted % on Time =&lt;/SPAN&gt; &lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Master INV'&lt;/SPAN&gt;&lt;SPAN&gt;[Field]&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;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Master INV'&lt;/SPAN&gt;&lt;SPAN&gt;[Ratio for on time completion calculation]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;'Master INV'&lt;/SPAN&gt;&lt;SPAN&gt;[Alloted_Prep_Time]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;)/&lt;FONT color="#FF0000"&gt;&lt;EM&gt;(&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;FILTER (&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ADDCOLUMNS (&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VALUES ( 'Master INV'[Field] ),&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "minv",&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR current_field = CALCULATE ( SELECTEDVALUE ( 'Master INV'[Field] ) )&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RETURN&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CALCULATE ( MIN ( 'Master INV'[Alloted_Prep_Time] ), 'Master INV'[Field] = current_field )&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ),&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [minv] &amp;gt;= 0&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; )&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; RETURN&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; COUNTROWS(t)&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; *&lt;/SPAN&gt;&lt;SPAN&gt;100&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The RETURN command does not play nicely. I hope this gives better idea to what I am trying to do. Thank you for your resolution, you infact did answer my original question, I failed to ask exactly what I needed.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 15 Sep 2023 21:06:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3433563#M130211</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-15T21:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT of Rows filtered by other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3434052#M130243</link>
      <description>&lt;P&gt;I don't know what you're trying to calculate. Your example contains more columns. You need to provide a correct demo with the expected result.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 14:01:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3434052#M130243</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2023-09-16T14:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: DISTINCTCOUNT of Rows filtered by other column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3436120#M130378</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To calculate the distinct count of rows in the "Field" column, excluding those with a "Time" value less than 0, you can create a DAX measure. Here's how you can do it:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;DistinctCountFiltered = VAR FilteredTable = FILTER('YourTableName', 'YourTableName'[Time] &amp;gt;= 0) RETURN DISTINCTCOUNTX(FilteredTable, 'YourTableName'[Field])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Replace 'YourTableName' with the actual name of your table.&lt;/P&gt;&lt;P&gt;This measure first filters the table to exclude rows where the "Time" column has a value less than 0. Then, it calculates the distinct count of the "Field" column based on the filtered table.&lt;/P&gt;&lt;P&gt;Once you create this measure, you can use it in a card visual to display the sum of distinct "Field" values without negative "Time" values.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 12:13:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DISTINCTCOUNT-of-Rows-filtered-by-other-column/m-p/3436120#M130378</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-09-18T12:13:10Z</dc:date>
    </item>
  </channel>
</rss>

