<?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: Cumulative Reject Count in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3556909#M136961</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please provide your sample pbix file's link (onedrive, google drive, dropbox, or others), and then I can try to look into the sample.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Nov 2023 16:29:23 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-11-28T16:29:23Z</dc:date>
    <item>
      <title>Cumulative Reject Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3555711#M136856</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with all the rejects information for individual items. I want to do a cumulative of all the rejects description for individual items.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see above, the _cumReject works normal until Oil Stains reject, when the reject count reach 1, it stop cumulate and showthe total number of reject instead. By right it should continue to cumulate the rejects (Which is 10 at Clamping Marks). May i sincerly request assist on these. My formula are as below. Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Reject Count =&lt;/SPAN&gt; &lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;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gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_CumComp&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;_CumCompTable&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[@Count]&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;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;_CumComp&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 06:24:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3555711#M136856</guid>
      <dc:creator>Hongmingk</dc:creator>
      <dc:date>2023-11-28T06:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Reject Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3555765#M136860</link>
      <description>&lt;P&gt;Hi, I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I hope the below can provide some ideas on how to create a solution for your semantic model.&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;A href="https://learn.microsoft.com/en-us/dax/window-function-dax?wt.mc_id=DP-MVP-5004989" target="_blank"&gt;WINDOW function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&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;LI-CODE lang="markup"&gt;Cumulative reject count: =
VAR _t =
    ADDCOLUMNS (
        SUMMARIZE ( ALL ( reject_fct ), item_dim[Category], item_dim[Item] ),
        "@rejectcount", CALCULATE ( COUNTROWS ( reject_fct ), reject_fct[Reject Description] = 1 )
    )
RETURN
    SUMX (
        WINDOW (
            1,
            ABS,
            0,
            REL,
            _t,
            ORDERBY ( [@rejectcount], DESC, item_dim[Item], ASC ),
            ,
            PARTITIONBY ( item_dim[Category] )
        ),
        [@rejectcount]
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 06:50:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3555765#M136860</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-11-28T06:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Reject Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3556236#M136882</link>
      <description>&lt;P&gt;Hi, Thanks for the replies. Actually i only have one table. There's no other table to link the relation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to create a new table similar to Item_Dim. Unfortunally i cant use the way you provided. As my reject description has duplicate value due to some of the item have similar reject descriptions as reflected in the table below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hence, may i ask is there any other ways to achieve the results?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 10:22:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3556236#M136882</guid>
      <dc:creator>Hongmingk</dc:creator>
      <dc:date>2023-11-28T10:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Reject Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3556909#M136961</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please provide your sample pbix file's link (onedrive, google drive, dropbox, or others), and then I can try to look into the sample.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Nov 2023 16:29:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3556909#M136961</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-11-28T16:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Reject Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3557724#M137001</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly find the pbix file's link and the excel file sample link below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!AjltHNuruLFq2Cvd6mJQtjJpuKSZ?e=eWrkFQ" target="_blank"&gt;Reject Visual.pbix&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/x/s!AjltHNuruLFq2Cy2pEO_5uPqFrbG?e=EiWCMW" target="_blank"&gt;Rejects_Data.xlsx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much apperiacted for your help. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 02:15:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3557724#M137001</guid>
      <dc:creator>Hongmingk</dc:creator>
      <dc:date>2023-11-29T02:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Reject Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3557831#M137008</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file if it suits your requirement.&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;LI-CODE lang="markup"&gt;_cumReject =
IF (
    ISINSCOPE ( 'Reject Data'[Reject Desciption] ),
    VAR _allselectedComp =
        ALLSELECTED ( 'Reject Data'[Reject Desciption] )
    VAR _CompTable =
        ADDCOLUMNS ( _allselectedComp, "@Count", 'Reject Data'[Reject Count] )
    RETURN
        SUMX (
            WINDOW (
                1,
                ABS,
                0,
                REL,
                _CompTable,
                ORDERBY ( [@Count], DESC, 'Reject Data'[Reject Desciption], ASC )
            ),
            [@Count]
        )
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Nov 2023 03:53:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3557831#M137008</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-11-29T03:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative Reject Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3559937#M137180</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It work perfectly! Thanks alot for your assist and guidance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 01:02:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-Reject-Count/m-p/3559937#M137180</guid>
      <dc:creator>Hongmingk</dc:creator>
      <dc:date>2023-11-30T01:02:28Z</dc:date>
    </item>
  </channel>
</rss>

