<?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 DAX help - counting single item lines in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4791021#M183392</link>
    <description>&lt;P&gt;I have&amp;nbsp; measure to count PO's with single items&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It kinda works but doesnt sum per day / week / per year&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;My measure is ;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt; Items per PO =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sage_POPOrderReturnLine&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; , &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sage_POPOrderReturnLine&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;Sage_POPOrderReturnLine&lt;/SPAN&gt;&lt;SPAN&gt;[ItemCode]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;1&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;I have tried summerize but I am not getting the syntax correct.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Aug 2025 09:03:20 GMT</pubDate>
    <dc:creator>Si_7777</dc:creator>
    <dc:date>2025-08-08T09:03:20Z</dc:date>
    <item>
      <title>DAX help - counting single item lines</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4791021#M183392</link>
      <description>&lt;P&gt;I have&amp;nbsp; measure to count PO's with single items&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It kinda works but doesnt sum per day / week / per year&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;My measure is ;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt; Items per PO =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sage_POPOrderReturnLine&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; , &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sage_POPOrderReturnLine&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;Sage_POPOrderReturnLine&lt;/SPAN&gt;&lt;SPAN&gt;[ItemCode]&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;1&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;I have tried summerize but I am not getting the syntax correct.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 09:03:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4791021#M183392</guid>
      <dc:creator>Si_7777</dc:creator>
      <dc:date>2025-08-08T09:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - counting single item lines</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4791220#M183400</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="687546" data-lia-user-login="Si_7777" class="lia-mention lia-mention-user"&gt;Si_7777&lt;/a&gt;&amp;nbsp;, Thank you for reaching out to the Microsoft Community Forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We took sample data based on your scenario and recreated your matrix structure with Year -&amp;gt; Date -&amp;gt; PO Number. We rewrote the 1 Items per PO measure to first identify POs that have exactly one distinct item, then count them in the current filter context. This ensures the count is accurate at PO, daily and yearly levels without double-counting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check the attached .pbix file for your reference and share your thoughts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 12:12:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4791220#M183400</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-08-08T12:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - counting single item lines</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4792490#M183430</link>
      <description>&lt;P&gt;Hi Si_7777,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The main issue is you need it to check for 1 item on the PO by day and order, before rolling it up to the different levels in your hierarchy. However, the way your measure is written, it is, for example, checking for 1 item on the PO for the whole year at the top level in your matrix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;1 Item per PO =
VAR _Summarized =
    FILTER (
        SUMMARIZE (
            Dates[Year], -- first field in your matrix row hierarchy
            Dates[Month], -- second field in your matrix row hierarchy
            Dates[Date], -- third field in your matrix row hierarchy
            Sage_POPOrderReturnLine[POPOrderNumber] -- fourth field in your matrix row hierarchy
        ),
        CALCULATE ( DISTINCTCOUNT ( Sage_POPOrderReturnLine[ItemCode] ) = 1
    )
VAR _Result = COUNTROWS ( _Summarized )

RETURN _Result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;FONT size="2"&gt;----------------------------------&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on &lt;A href="https://www.upwork.com/freelancers/~01bc08c63d83566d45" target="_blank"&gt;Upwork&lt;/A&gt; or DM me directly on here! I would love to clear up your Power BI headaches.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Aug 2025 22:01:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4792490#M183430</guid>
      <dc:creator>Wilson_</dc:creator>
      <dc:date>2025-08-10T22:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - counting single item lines</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4793090#M183455</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="687546" data-lia-user-login="Si_7777" class="lia-mention lia-mention-user"&gt;Si_7777&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;SPAN data-teams="true"&gt;hope you are doing great. May we know if your issue is solved or if you are still experiencing difficulties. Please share the details as it will help the community, especially others with similar issues.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Aug 2025 11:17:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4793090#M183455</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-08-11T11:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - counting single item lines</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4799415#M183629</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="687546" data-lia-user-login="Si_7777" class="lia-mention lia-mention-user"&gt;Si_7777&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;SPAN data-teams="true"&gt;Hope you are doing well. Kindly let us know if the issue has been resolved or if further assistance is needed. Your input could be helpful to others in the community.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2025 06:40:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4799415#M183629</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-08-18T06:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - counting single item lines</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4803002#M183722</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="687546" data-lia-user-login="Si_7777" class="lia-mention lia-mention-user"&gt;Si_7777&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;SPAN data-teams="true"&gt;Hope you're doing fine. Can you confirm if the problem is solved or still persists? Sharing your details will help others in the community.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Aug 2025 05:01:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-counting-single-item-lines/m-p/4803002#M183722</guid>
      <dc:creator>v-hashadapu</dc:creator>
      <dc:date>2025-08-21T05:01:08Z</dc:date>
    </item>
  </channel>
</rss>

