<?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: Get orders from top 10% of customers in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-orders-from-top-10-of-customers/m-p/3773368#M147443</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="707790" data-lia-user-login="will_lamslecz" class="lia-mention lia-mention-user"&gt;will_lamslecz&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jihwan_Kim&amp;nbsp;said it very well, his method is very good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try my different method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please follow my steps below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, here is the sample data I created, which are the Sales table and the Order table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, create a calculated column that ranks customers based on their sales.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Customer Sales Rank = RANKX(ALL(Sales), Sales[Sales], , DESC, Dense)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, create a calculated column to take out the information of the first four customers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is the first four customers, it is equal to true, if not, it is equal to false.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Is Top Customer = IF(Sales[Customer Sales Rank] IN { 1,2,3,4}, TRUE, FALSE)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apply the measure to a visual-level Filter that only displays True.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pbix file is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would be grateful if you could provide me with sample data for testing, please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2024 05:21:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-03-19T05:21:31Z</dc:date>
    <item>
      <title>Get orders from top 10% of customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-orders-from-top-10-of-customers/m-p/3772602#M147408</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;I am trying to create a measure that returns the number of orders from the customers who make up the top 10% of sales. For example, if total sales is $100, and the top 4 customers make up $10 of sales, and those 4 customers have a collective 20 orders, it would return 20.&amp;nbsp;&lt;BR /&gt;I'd like to know how I could go about doing this.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 20:49:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-orders-from-top-10-of-customers/m-p/3772602#M147408</guid>
      <dc:creator>will_lamslecz</dc:creator>
      <dc:date>2024-03-18T20:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get orders from top 10% of customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-orders-from-top-10-of-customers/m-p/3772627#M147412</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;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 whether it suits your requirement.&lt;/P&gt;
&lt;P&gt;Please be noted that in my sample, I tried to find top 50 % customers order count.&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;&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;
&lt;LI-CODE lang="markup"&gt;Sales: = 
    SUM( sales[sales] )&lt;/LI-CODE&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;
&lt;LI-CODE lang="markup"&gt;Order count: = 
    COUNTROWS(sales)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&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" rel="noopener"&gt;WINDOW function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;top % sales: = 
VAR _allsales =
    CALCULATE ( [Sales:], REMOVEFILTERS ( customer ) )
VAR _runningsalesdesc =
    CALCULATE (
        [Sales:],
        WINDOW (
            1,
            ABS,
            0,
            REL,
            ALL ( customer[customer_id] ),
            ORDERBY ( [Sales:], DESC )
        )
    )
VAR _percentage =
    DIVIDE ( _runningsalesdesc, _allsales )
RETURN
    _percentage&lt;/LI-CODE&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;
&lt;LI-CODE lang="markup"&gt;Top 50% customer ordercount = 
VAR _customerlist =
    FILTER ( VALUES ( customer[customer_id] ), [top % sales:] &amp;lt;= 0.5 )
RETURN
    CALCULATE (
        [Order count:],
        FILTER ( customer, customer[customer_id] IN _customerlist )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2024 21:22:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-orders-from-top-10-of-customers/m-p/3772627#M147412</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-03-18T21:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get orders from top 10% of customers</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-orders-from-top-10-of-customers/m-p/3773368#M147443</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="707790" data-lia-user-login="will_lamslecz" class="lia-mention lia-mention-user"&gt;will_lamslecz&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jihwan_Kim&amp;nbsp;said it very well, his method is very good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try my different method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please follow my steps below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, here is the sample data I created, which are the Sales table and the Order table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, create a calculated column that ranks customers based on their sales.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Customer Sales Rank = RANKX(ALL(Sales), Sales[Sales], , DESC, Dense)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, create a calculated column to take out the information of the first four customers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is the first four customers, it is equal to true, if not, it is equal to false.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Is Top Customer = IF(Sales[Customer Sales Rank] IN { 1,2,3,4}, TRUE, FALSE)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apply the measure to a visual-level Filter that only displays True.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pbix file is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would be grateful if you could provide me with sample data for testing, please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 05:21:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-orders-from-top-10-of-customers/m-p/3773368#M147443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-19T05:21:31Z</dc:date>
    </item>
  </channel>
</rss>

