<?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: Calculating number of shops that sold at least N quantity of a single item in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-number-of-shops-that-sold-at-least-N-quantity-of-a/m-p/3416414#M129277</link>
    <description>&lt;P&gt;Instead of&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FILTER( 
        F_Sales_22May23, 
        SUM(F_Sales_22May23[QtyPieces])&amp;gt; 4 
        )&lt;/LI-CODE&gt;
&lt;P&gt;use&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FILTER( 
        F_Sales_22May23, 
        [QtyPieces]&amp;gt; 4 
        )&lt;/LI-CODE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;F_Sales_22May23[QtyPieces]&amp;gt; 4 
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same with the &amp;lt;4 approach.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2023 19:46:24 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2023-09-05T19:46:24Z</dc:date>
    <item>
      <title>Calculating number of shops that sold at least N quantity of a single item</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-number-of-shops-that-sold-at-least-N-quantity-of-a/m-p/3414219#M129132</link>
      <description>&lt;P&gt;I have a sale table that looks like this:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;BookingDate&lt;/TD&gt;&lt;TD&gt;ShopId&lt;/TD&gt;&lt;TD&gt;ArticleId&lt;/TD&gt;&lt;TD&gt;QtyPieces&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/05/2023&lt;/TD&gt;&lt;TD&gt;704788&lt;/TD&gt;&lt;TD&gt;31452&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/05/2023&lt;/TD&gt;&lt;TD&gt;704788&lt;/TD&gt;&lt;TD&gt;30891&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/05/2023&lt;/TD&gt;&lt;TD&gt;704788&lt;/TD&gt;&lt;TD&gt;30544&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And would like to know how many shops have sold at least 4 total quantity for each of the articles&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My matrix is setup as following&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;the values are:&lt;/P&gt;&lt;P&gt;Distinct count of shops, sum of QtyPieces and Distinct count of shops where at least 4 of the article is sold.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE( 
    DISTINCTCOUNT(F_Sales_22May23[ClientId]), 
    FILTER( 
        F_Sales_22May23, 
        SUM(F_Sales_22May23[QtyPieces])&amp;gt; 4 
        )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the result is&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;because the formulla evaluates for each filter context individually, the number of distinct shops = number of shops with at least 4 in quantity sales.&amp;nbsp;&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;How do i rewrite the formulla so the totals only count shops that have less than 4 Qty sales.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 16:39:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-number-of-shops-that-sold-at-least-N-quantity-of-a/m-p/3414219#M129132</guid>
      <dc:creator>DonTwan</dc:creator>
      <dc:date>2023-09-04T16:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating number of shops that sold at least N quantity of a single item</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-number-of-shops-that-sold-at-least-N-quantity-of-a/m-p/3416414#M129277</link>
      <description>&lt;P&gt;Instead of&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FILTER( 
        F_Sales_22May23, 
        SUM(F_Sales_22May23[QtyPieces])&amp;gt; 4 
        )&lt;/LI-CODE&gt;
&lt;P&gt;use&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FILTER( 
        F_Sales_22May23, 
        [QtyPieces]&amp;gt; 4 
        )&lt;/LI-CODE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;F_Sales_22May23[QtyPieces]&amp;gt; 4 
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same with the &amp;lt;4 approach.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 19:46:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-number-of-shops-that-sold-at-least-N-quantity-of-a/m-p/3416414#M129277</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2023-09-05T19:46:24Z</dc:date>
    </item>
  </channel>
</rss>

