<?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: How to exclude top 5% of values from the dataset using DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/4006821#M156859</link>
    <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;,I have created this measure, But dont see any diffenece in the NSR Number count. I just have to exclude the extra NSRs (Top 5%) who have greatest Avg Days values in the dataset. By a button click these Top 5% NSRs should be excluded.&amp;nbsp; Created below 2 Dax measures are not working as expected.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DAX 1:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;ExcludeTop5Percent =&lt;BR /&gt;VAR rowstoexclude =&lt;BR /&gt;ROUNDUP ( COUNTROWS ( 'ExcludeTbl' ) * 0.05, 0 )&lt;BR /&gt;VAR _rank =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;'ExcludeTbl',&lt;BR /&gt;"Rank",&lt;BR /&gt;RANKX (&lt;BR /&gt;ALL ( 'ExcludeTbl' ),&lt;BR /&gt;'ExcludeTbl'[NSR Approval Cycle Time(Actual)],&lt;BR /&gt;,&lt;BR /&gt;DESC,&lt;BR /&gt;DENSE&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;AVERAGEX (&lt;BR /&gt;FILTER ( _rank, [Rank] &amp;gt; rowstoexclude ),&lt;BR /&gt;'ExcludeTbl'[NSR Approval Cycle Time(Actual)]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;DAX 2:&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;Top 5% =&lt;BR /&gt;VAR _Avg =&lt;BR /&gt;AVERAGE('ExcludeTbl'[NSR Approval Cycle Time(Actual) ])&lt;BR /&gt;VAR _top =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;COUNTROWS ( ADDCOLUMNS ( VALUES ( ExcludeTbl[nsrnum] ), "_Avg", _Avg ) ),&lt;BR /&gt;REMOVEFILTERS ( ExcludeTbl[nsrnum] )&lt;BR /&gt;) * 0.05&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CALCULATE (&lt;BR /&gt;CALCULATE ( AVERAGE('ExcludeTbl'[NSR Approval Cycle Time(Actual) ]) ),&lt;BR /&gt;KEEPFILTERS (&lt;BR /&gt;TOPN (&lt;BR /&gt;_top,&lt;BR /&gt;ALLSELECTED ( ExcludeTbl[nsrnum] ),&lt;BR /&gt;CALCULATE ( AVERAGE('ExcludeTbl'[NSR Approval Cycle Time(Actual) ]) ), DESC&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;Tanisha&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 24 Jun 2024 12:07:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-24T12:07:10Z</dc:date>
    <item>
      <title>How to exclude top 5% of values from the dataset using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/3998700#M155865</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;How to exclude top 5% of values from the dataset using DAX?&amp;nbsp;&lt;BR /&gt;Example: 100 line items in the grid. A Button is clicked to exclude the 5% greatest average of days(Cycle Time) line items from the dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;Tanisha&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2024 17:14:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/3998700#M155865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-18T17:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude top 5% of values from the dataset using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/3999421#M155867</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="457209" data-lia-user-login="Ritaf1983" class="lia-mention lia-mention-user"&gt;Ritaf1983&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;very much for the solution,&amp;nbsp;, to help you understand the problem, I also tried some other ways to solve the problem:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 = VAR rowstoexclude=ROUNDUP(COUNTROWS('Table (2)')*0.05,0)
VAR _rank = 
   ADDCOLUMNS('Table (2)',"Rank",RANKX(ALL('Table (2)'),[averagedays],,DESC,Dense))
   RETURN SUMX(FILTER(_rank,[Rank]&amp;gt;rowstoexclude),[averagedays])&lt;/LI-CODE&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&gt;Hope it helps!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team_ Tom Shen&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post helps then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 06:42:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/3999421#M155867</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-19T06:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude top 5% of values from the dataset using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/4006821#M156859</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/a&gt;&amp;nbsp;,I have created this measure, But dont see any diffenece in the NSR Number count. I just have to exclude the extra NSRs (Top 5%) who have greatest Avg Days values in the dataset. By a button click these Top 5% NSRs should be excluded.&amp;nbsp; Created below 2 Dax measures are not working as expected.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DAX 1:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;ExcludeTop5Percent =&lt;BR /&gt;VAR rowstoexclude =&lt;BR /&gt;ROUNDUP ( COUNTROWS ( 'ExcludeTbl' ) * 0.05, 0 )&lt;BR /&gt;VAR _rank =&lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;'ExcludeTbl',&lt;BR /&gt;"Rank",&lt;BR /&gt;RANKX (&lt;BR /&gt;ALL ( 'ExcludeTbl' ),&lt;BR /&gt;'ExcludeTbl'[NSR Approval Cycle Time(Actual)],&lt;BR /&gt;,&lt;BR /&gt;DESC,&lt;BR /&gt;DENSE&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;AVERAGEX (&lt;BR /&gt;FILTER ( _rank, [Rank] &amp;gt; rowstoexclude ),&lt;BR /&gt;'ExcludeTbl'[NSR Approval Cycle Time(Actual)]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;DAX 2:&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;Top 5% =&lt;BR /&gt;VAR _Avg =&lt;BR /&gt;AVERAGE('ExcludeTbl'[NSR Approval Cycle Time(Actual) ])&lt;BR /&gt;VAR _top =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;COUNTROWS ( ADDCOLUMNS ( VALUES ( ExcludeTbl[nsrnum] ), "_Avg", _Avg ) ),&lt;BR /&gt;REMOVEFILTERS ( ExcludeTbl[nsrnum] )&lt;BR /&gt;) * 0.05&lt;BR /&gt;&lt;BR /&gt;RETURN&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;CALCULATE (&lt;BR /&gt;CALCULATE ( AVERAGE('ExcludeTbl'[NSR Approval Cycle Time(Actual) ]) ),&lt;BR /&gt;KEEPFILTERS (&lt;BR /&gt;TOPN (&lt;BR /&gt;_top,&lt;BR /&gt;ALLSELECTED ( ExcludeTbl[nsrnum] ),&lt;BR /&gt;CALCULATE ( AVERAGE('ExcludeTbl'[NSR Approval Cycle Time(Actual) ]) ), DESC&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;Tanisha&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Jun 2024 12:07:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/4006821#M156859</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-24T12:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude top 5% of values from the dataset using DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/4075352#M161808</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I'm sorry for not getting back to you until now, and I apologise for that.&lt;BR /&gt;If the reason it doesn't work is that it's not possible to use in measure&lt;BR /&gt;ROUNDUP ( COUNTROWS ( 'ExcludeTbl' ) * 0.05, 0 ) he calculates it step by step and summarises it at the end, so it will be wrong, we can use this formula to calculate the columns will solve this problem perfectly.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank = RANKX('CycleTimeData','CycleTimeData'[CycleTime],,DESC,Dense)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Column = ROUNDUP(COUNTROWS('CycleTimeData')*0.05,0)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Measure 2 = COALESCE(
  SUMX(FILTER(
    'CycleTimeData',
    'CycleTimeData'[Rank]&amp;gt;'CycleTimeData'[Column]),
    [CycleTime]),
    0
    )&lt;/LI-CODE&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;img /&gt;
&lt;P&gt;Once again, I apologise for not resolving your issue in a timely manner.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Community Support Team_ Tom Shen&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 02 Aug 2024 07:39:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-exclude-top-5-of-values-from-the-dataset-using-DAX/m-p/4075352#M161808</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-02T07:39:11Z</dc:date>
    </item>
  </channel>
</rss>

