<?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 with sum filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3559104#M137115</link>
    <description>&lt;P&gt;I don't understand why you're asking me to change my formula for yours when there's absolutely no change between mine and yours.&lt;BR /&gt;What's more, this formula doesn't work, it returns "null".&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2023 14:28:49 GMT</pubDate>
    <dc:creator>UserSam123</dc:creator>
    <dc:date>2023-11-29T14:28:49Z</dc:date>
    <item>
      <title>Distinctcount with sum filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3558687#M137096</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your help with the following problem.&lt;BR /&gt;In the table below I would like to create a measure that gives me a separate count when the sum of the number column is less than 20.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In this case I should have a thumbnail that displays 2, because the sum of "aaa" and "ccc" is less than 20.&lt;/P&gt;&lt;P&gt;What's more, the Date column is also a page slicer in the report, so will the measurement be dynamic depending on the choice in the slicer? All data are in the same table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 14:26:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3558687#M137096</guid>
      <dc:creator>UserSam123</dc:creator>
      <dc:date>2023-11-29T14:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Distinctcount with sum filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3558768#M137099</link>
      <description>&lt;P&gt;To create a measure that gives you a separate count when the sum of the number column is less than 20, you can use the following DAX formula:&lt;/P&gt;&lt;PRE&gt;Measure = CALCULATE(DISTINCTCOUNT(Table[Name]), SUM(Table[Number]) &amp;lt; 20)&lt;/PRE&gt;&lt;P&gt;This formula uses the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;CALCULATE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function to filter the table based on the condition that the sum of the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Number&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;column is less than 20. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DISTINCTCOUNT&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function then counts the number of unique values in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Name&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;column that meet this condition.&lt;/P&gt;&lt;P&gt;Regarding your question about the page slicer, the measure will be dynamic depending on the choice in the slicer as long as all the data is in the same table.&lt;/P&gt;&lt;P&gt;I hope this helps! Let me know if you have any further questions.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 12:00:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3558768#M137099</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-11-29T12:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Distinctcount with sum filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3558935#M137110</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for the feedback, but I've already used this formula and it didn't work, which is why I'm coming to you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I use this one and it returns null. When I use yours, it sends me this error message: True/False expression doesn't specify a column&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 13:23:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3558935#M137110</guid>
      <dc:creator>UserSam123</dc:creator>
      <dc:date>2023-11-29T13:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Distinctcount with sum filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3558976#M137112</link>
      <description>&lt;P&gt;I’m sorry to hear that the formula I provided didn’t work for you.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://stackoverflow.com/questions/50036561/count-and-sum-unique-values-power-bi" target="_blank" rel="noopener"&gt;The error message “True/False expression doesn’t specify a column” usually occurs when each True/False expression used as a table filter expression must refer to exactly one column&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="https://stackoverflow.com/questions/50036561/count-and-sum-unique-values-power-bi" target="_blank" rel="noopener"&gt;1&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Based on the screenshot you provided, it looks like you are using an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;IF&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement in your formula.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://stackoverflow.com/questions/50036561/count-and-sum-unique-values-power-bi" target="_blank" rel="noopener"&gt;If this is the case, you may need to wrap your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;IF&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;statement in a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;FILTER&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function to fix the issue&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="https://stackoverflow.com/questions/50036561/count-and-sum-unique-values-power-bi" target="_blank" rel="noopener"&gt;1&lt;/A&gt;. Here’s an example of how you can modify the formula:&lt;/P&gt;&lt;PRE&gt;Measure = CALCULATE(DISTINCTCOUNT(Table[Column]), FILTER(Table, SUM(Table[Number]) &amp;lt; 20))&lt;/PRE&gt;&lt;P&gt;This formula uses the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;FILTER&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function to filter the table based on the condition that the sum of the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Number&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;column is less than 20. The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DISTINCTCOUNT&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function then counts the number of distinct values in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Column&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;column for the filtered table.&lt;/P&gt;&lt;P&gt;Regarding your question about the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Date&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;column being a page slicer, the measure will be dynamic depending on the choice in the slicer as long as all the data is in the same table.&lt;/P&gt;&lt;P&gt;I hope this helps! Let me know if you have any further questions.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 13:39:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3558976#M137112</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-11-29T13:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Distinctcount with sum filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3559104#M137115</link>
      <description>&lt;P&gt;I don't understand why you're asking me to change my formula for yours when there's absolutely no change between mine and yours.&lt;BR /&gt;What's more, this formula doesn't work, it returns "null".&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 14:28:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3559104#M137115</guid>
      <dc:creator>UserSam123</dc:creator>
      <dc:date>2023-11-29T14:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Distinctcount with sum filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3559268#M137127</link>
      <description>&lt;P&gt;For your information, I succeeded in doing this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;__tmpTable&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Table&lt;/SPAN&gt;&lt;SPAN&gt;[Name]&lt;/SPAN&gt;&lt;SPAN&gt; ,&lt;/SPAN&gt;&lt;SPAN&gt;"__Brands"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table&lt;/SPAN&gt;&lt;SPAN&gt;[Quantity]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&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;Table&lt;/SPAN&gt;&lt;SPAN&gt;[Name]&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;__tmpTable&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[__Brands]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;20&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Nov 2023 15:39:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3559268#M137127</guid>
      <dc:creator>UserSam123</dc:creator>
      <dc:date>2023-11-29T15:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Distinctcount with sum filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3559272#M137128</link>
      <description>&lt;P&gt;hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="529242" data-lia-user-login="UserSam123" class="lia-mention lia-mention-user"&gt;UserSam123&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;try below&lt;/P&gt;&lt;P&gt;just adjust your table name&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;output = 
var a =ADDCOLUMNS(
        SUMMARIZE('Table','Table'[date],'Table'[name]),
         "d",CALCULATE(SUM('Table'[number]))
        )
RETURN
COUNTX(FILTER(a,[d]&amp;lt;20),'Table'[name])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 15:42:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinctcount-with-sum-filter/m-p/3559272#M137128</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2023-11-29T15:42:44Z</dc:date>
    </item>
  </channel>
</rss>

