<?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 Exclude Bottom 5% sales and calculate 75th percentile of the top 95% sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2852357#M91510</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help with DAX that calculate the 75th percentile of sales the top 95% salespeople by sales. I have attached a Excel snippet of expected results. Sales highlighted in yellow need to be excluded from the table of users that will be used to calculate the 75th percentile. I can calculated the percentile in DAX but stuck on filtering out the bottom 5% salespeople&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;--sales percentile
VAR Percentile75 = 0.75
 --bottom 5% salespeople to be excluded
VAR SalespeopleExcluded = 0.05
--selected state
VAR StateinContext =
    SUMMARIZE ( 'Sales', 'Sales'[State] ) 

--total sales for entire state
VAR TotalSales =
    CALCULATE (
        [Sales],
        StateinContext,
        ALL('Sales'[Salesperson]),

    )
VAR SalesBySalesperson =
    FILTER (
        CALCULATETABLE (
            ADDCOLUMNS (
                CALCULATETABLE (
                    SUMMARIZE (
                        'Sales',
                        'Sales'[Salesperson]

                    )
                ),
                "@SalespersonProportionofSales%", CALCULATE ( DIVIDE ( [Sales], TotalSales ) ),
                "@Sales", [Sales]
            ),
            ALL ( 'Sales'[Salesperson] )
            ,StateinContext
        ),
        [@SalespersonProportionofSales%] &amp;gt; SalespeopleExcluded
            &amp;amp;&amp;amp; [@Sales] &amp;lt;&amp;gt; BLANK ()
    )
VAR Result =
    CALCULATE (
        PERCENTILEX.INC (
            SalesBySalesperson,
            [@Sales],
            Percentile75
        )
    )
RETURN
Result&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 02:19:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-10-20T02:19:11Z</dc:date>
    <item>
      <title>DAX Exclude Bottom 5% sales and calculate 75th percentile of the top 95% sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2852357#M91510</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help with DAX that calculate the 75th percentile of sales the top 95% salespeople by sales. I have attached a Excel snippet of expected results. Sales highlighted in yellow need to be excluded from the table of users that will be used to calculate the 75th percentile. I can calculated the percentile in DAX but stuck on filtering out the bottom 5% salespeople&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;--sales percentile
VAR Percentile75 = 0.75
 --bottom 5% salespeople to be excluded
VAR SalespeopleExcluded = 0.05
--selected state
VAR StateinContext =
    SUMMARIZE ( 'Sales', 'Sales'[State] ) 

--total sales for entire state
VAR TotalSales =
    CALCULATE (
        [Sales],
        StateinContext,
        ALL('Sales'[Salesperson]),

    )
VAR SalesBySalesperson =
    FILTER (
        CALCULATETABLE (
            ADDCOLUMNS (
                CALCULATETABLE (
                    SUMMARIZE (
                        'Sales',
                        'Sales'[Salesperson]

                    )
                ),
                "@SalespersonProportionofSales%", CALCULATE ( DIVIDE ( [Sales], TotalSales ) ),
                "@Sales", [Sales]
            ),
            ALL ( 'Sales'[Salesperson] )
            ,StateinContext
        ),
        [@SalespersonProportionofSales%] &amp;gt; SalespeopleExcluded
            &amp;amp;&amp;amp; [@Sales] &amp;lt;&amp;gt; BLANK ()
    )
VAR Result =
    CALCULATE (
        PERCENTILEX.INC (
            SalesBySalesperson,
            [@Sales],
            Percentile75
        )
    )
RETURN
Result&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 02:19:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2852357#M91510</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-20T02:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Exclude Bottom 5% sales and calculate 75th percentile of the top 95% sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2852479#M91516</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I tried to create a sample pbix file like below, and I hope the below can provide some ideas on how to create a solution for your datamodel.&lt;/P&gt;
&lt;P&gt;All measures are in the attached pbix file.&lt;/P&gt;
&lt;P&gt;In the below, by using the measure [Percentage cumulate except bottom 5%:], the desired result can be shown.&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 03:28:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2852479#M91516</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2022-10-20T03:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Exclude Bottom 5% sales and calculate 75th percentile of the top 95% sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2852483#M91517</link>
      <description>&lt;P&gt;It's nothing but just 75%*95%=71.25% percentile of the whole set.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 03:30:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2852483#M91517</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2022-10-20T03:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: DAX Exclude Bottom 5% sales and calculate 75th percentile of the top 95% sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2854280#M91669</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 18:26:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Exclude-Bottom-5-sales-and-calculate-75th-percentile-of-the/m-p/2854280#M91669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-20T18:26:39Z</dc:date>
    </item>
  </channel>
</rss>

