<?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: To get year corresponding to maximum sales in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/To-get-year-corresponding-to-maximum-sales/m-p/2346375#M59368</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to create a rank measure, then add this measure into visual level filter and set it to show items when value =1.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank =
RANKX (
    FILTER ( ALL ( 'Table' ), 'Table'[Category] = MAX ( 'Table'[Category] ) ),
    CALCULATE ( SUM ( 'Table'[Sales] ) ),
    ,
    DESC,
    DENSE
)&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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>Fri, 18 Feb 2022 02:52:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-02-18T02:52:32Z</dc:date>
    <item>
      <title>To get year corresponding to maximum sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/To-get-year-corresponding-to-maximum-sales/m-p/2340118#M59028</link>
      <description>&lt;P&gt;I want to get the&amp;nbsp;year corresponding to maximum sales. See data below&lt;/P&gt;&lt;P&gt;Input:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Expected Output:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Help me with a DAX to get the result&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 16:15:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/To-get-year-corresponding-to-maximum-sales/m-p/2340118#M59028</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-15T16:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: To get year corresponding to maximum sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/To-get-year-corresponding-to-maximum-sales/m-p/2340152#M59032</link>
      <description>&lt;P&gt;Hello there&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;! Check if this works for you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Max Sales Year =
CALCULATE (
    SELECTEDVALUE ( 'Your_Table'[Year] ),
    FILTER ( 'Your_Table', [Sales] = MAX ( [Sales] ) )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For max sales you can use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Max Sales =
 MAX ( 'Your_Table'[Sales] ) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this answer solves your problem!&lt;BR /&gt;If you need any additional help please &lt;SPAN&gt;@&lt;/SPAN&gt; me in your reply.&lt;BR /&gt;If my reply provided you with a solution, please consider marking it as a solution &lt;span class="lia-unicode-emoji" title=":heavy_check_mark:"&gt;✔️&lt;/span&gt; or giving it a kudoe &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/gon%C3%A7alo-costa-b32253159" target="_blank" rel="noopener"&gt;You can also check out my LinkedIn!&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Gonçalo Geraldes&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 16:36:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/To-get-year-corresponding-to-maximum-sales/m-p/2340152#M59032</guid>
      <dc:creator>goncalogeraldes</dc:creator>
      <dc:date>2022-02-15T16:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: To get year corresponding to maximum sales</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/To-get-year-corresponding-to-maximum-sales/m-p/2346375#M59368</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to create a rank measure, then add this measure into visual level filter and set it to show items when value =1.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Rank =
RANKX (
    FILTER ( ALL ( 'Table' ), 'Table'[Category] = MAX ( 'Table'[Category] ) ),
    CALCULATE ( SUM ( 'Table'[Sales] ) ),
    ,
    DESC,
    DENSE
)&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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>Fri, 18 Feb 2022 02:52:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/To-get-year-corresponding-to-maximum-sales/m-p/2346375#M59368</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-02-18T02:52:32Z</dc:date>
    </item>
  </channel>
</rss>

