<?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 Grouping sales by customer percentile in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531004#M30045</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to make a chart, similiar to the one below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to dynamically categorize the customers into percentiles (top1%, top2% and so on). If we had 1000 customers let's say, I would need 1% to show the combined Volume of top10 customers, 2% to show the combined Volume of the #11-20 customers, and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a table for percentiles (which I use on x axis):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Percentiles = GENERATESERIES(0.01, 1, 0.01)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the following measure:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = PERCENTILEX.INC(Sales, [Volume], VALUES('Percentiles'[Percentile]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, that only shows n-th Volume (i.e. the Volume of customer that's at 1% mark, at 2% mark, etc. What I need here though, is the aggregate of Volume for all customers between 0-1%, 1-2%, respectively.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate your help a lot.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Dec 2020 12:38:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-12-03T12:38:14Z</dc:date>
    <item>
      <title>Grouping sales by customer percentile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531004#M30045</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to make a chart, similiar to the one below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal is to dynamically categorize the customers into percentiles (top1%, top2% and so on). If we had 1000 customers let's say, I would need 1% to show the combined Volume of top10 customers, 2% to show the combined Volume of the #11-20 customers, and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a table for percentiles (which I use on x axis):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Percentiles = GENERATESERIES(0.01, 1, 0.01)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the following measure:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = PERCENTILEX.INC(Sales, [Volume], VALUES('Percentiles'[Percentile]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, that only shows n-th Volume (i.e. the Volume of customer that's at 1% mark, at 2% mark, etc. What I need here though, is the aggregate of Volume for all customers between 0-1%, 1-2%, respectively.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate your help a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 12:38:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531004#M30045</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-03T12:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping sales by customer percentile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531037#M30049</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new measure using the one you already have:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure_cumul =
SUMX (
    VAR currentPerc_ =
        MAX ( 'Percentiles'[Percentile] )
    RETURN
        CALCULATETABLE (
            DISTINCT ( 'Percentiles'[Percentile] ),
            'Percentiles'[Percentile] &amp;lt;= currentPerc_
        ),
    [Measure]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 12:54:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531037#M30049</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-03T12:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping sales by customer percentile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531055#M30050</link>
      <description>&lt;P&gt;Hi, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried it out, but cumulative Volume is not exactly what I need here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The rephrasesd problem is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we have 1000 customers, for 1% percentile my 'Measure' returns only the Volume of #10th Customer, while instead I need it to aggregate #1 to #10. For 2% percentile I need it to aggregate #11 to #20 respectively, and so on.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 13:03:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531055#M30050</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-03T13:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Grouping sales by customer percentile</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531232#M30056</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this. You might have to tweak it a bit:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure V2 =
VAR currentPerc_ = MAX ( 'Percentiles'[Percentile] )
VAR previousPerc_ =
    CALCULATE (
        MAX ( 'Percentiles'[Percentile] ),
        'Percentiles'[Percentile] &amp;lt; currentPerc_
    )
VAR currentVol_ = [Measure]
VAR previousVol_ = CALCULATE ( [Measure], 'Percentiles'[Percentile] = previousPerc_ )
RETURN
    SUMX (
        FILTER (
            ADDCOLUMNS ( Sales, "res_", [Measure] ),
            [res_] &amp;lt;= currentVol_
                &amp;amp;&amp;amp; [res_] &amp;gt; previousVol_
        ),
        [res_]
    )
&lt;/LI-CODE&gt;
&lt;P&gt;If it doens't work it would help if you share the pbix with the expected result, or a simplified version with mock data and an example with the expected result&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Please mark the question solved when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Cheers&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 14:29:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Grouping-sales-by-customer-percentile/m-p/1531232#M30056</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2020-12-03T14:29:19Z</dc:date>
    </item>
  </channel>
</rss>

