<?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 top 6 month sales by client in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/top-6-month-sales-by-client/m-p/3456155#M131746</link>
    <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;i have a measure to calculate the total sales&lt;BR /&gt;[total Sales]&lt;BR /&gt;please, i want to calculate the top 6 sales by month by client ( start date from 06/2022 to 09/2023)&lt;/P&gt;&lt;P&gt;(the best 6 sales by month for each client)&lt;BR /&gt;&lt;BR /&gt;thank you&lt;/P&gt;</description>
    <pubDate>Mon, 02 Oct 2023 14:54:34 GMT</pubDate>
    <dc:creator>Sofinobi</dc:creator>
    <dc:date>2023-10-02T14:54:34Z</dc:date>
    <item>
      <title>top 6 month sales by client</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/top-6-month-sales-by-client/m-p/3456155#M131746</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;i have a measure to calculate the total sales&lt;BR /&gt;[total Sales]&lt;BR /&gt;please, i want to calculate the top 6 sales by month by client ( start date from 06/2022 to 09/2023)&lt;/P&gt;&lt;P&gt;(the best 6 sales by month for each client)&lt;BR /&gt;&lt;BR /&gt;thank you&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 14:54:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/top-6-month-sales-by-client/m-p/3456155#M131746</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2023-10-02T14:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: top 6 month sales by client</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/top-6-month-sales-by-client/m-p/3459124#M131904</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477984" data-lia-user-login="Sofinobi" class="lia-mention lia-mention-user"&gt;Sofinobi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to create a Calendar table which is connected to your data table to help your calculation.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calendar = ADDCOLUMNS(CALENDARAUTO(),"YearMonth",YEAR([Date]) * 100 +MONTH([Date]),"Month/Year",COMBINEVALUES("/",FORMAT(MONTH([Date]),"00"),YEAR([Date])))&lt;/LI-CODE&gt;
&lt;P&gt;Then create a rank measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank = 
VAR _SUMMARIZE =
    SUMMARIZE (
        ADDCOLUMNS ( ALL ( 'Table' ), "Month/Year", RELATED ( 'Calendar'[Month/Year] ) ),
        [Month/Year],
        [Customer],
        "Sum",
            SUMX (
                ADDCOLUMNS ( 'Table', "Month/Year", RELATED ( 'Calendar'[Month/Year] ) ),
                [Sales]
            )
    )
VAR _ADDRANK =
    ADDCOLUMNS (
        _SUMMARIZE,
        "RANKX",
            RANKX (
                FILTER ( _SUMMARIZE, [Month/Year] = EARLIER ( [Month/Year] ) ),
                [Sum],
                ,
                DESC,
                DENSE
            )
    )
RETURN
    SUMX (
        FILTER (
            _ADDRANK,
            [Month/Year] = MAX ( 'Calendar'[Month/Year] )
                &amp;amp;&amp;amp; [Customer] = MAX ( 'Table'[Customer] )
        ),
        [RANKX]
    )&lt;/LI-CODE&gt;
&lt;P&gt;Add this measure into visual level filter and set it to show items when value &amp;lt;=6.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 09:09:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/top-6-month-sales-by-client/m-p/3459124#M131904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-04T09:09:15Z</dc:date>
    </item>
  </channel>
</rss>

