<?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: How to get the month with the highest number? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3382249#M127446</link>
    <description>&lt;P&gt;Thnx &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="434309" data-lia-user-login="eliasayyy" class="lia-mention lia-mention-user"&gt;eliasayyy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I got it working. Understand what you are doing, but still fin dit hard to find out myself.&lt;BR /&gt;The issue her of course is also that you don't want the MAX of the whole dataset, but just the MAX of the last 13 months, while the dataset contains 4 years of data.&lt;BR /&gt;Thnx for helping me out&lt;/P&gt;</description>
    <pubDate>Wed, 16 Aug 2023 08:20:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-16T08:20:54Z</dc:date>
    <item>
      <title>How to get the month with the highest number?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3370959#M126847</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to solve, maybe someone can help.&lt;BR /&gt;This is a part from my FAC_Fraud_Schade table&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is the measure I try to create. I want to look 13 months back and from those 13 months I want the highest month value.&lt;BR /&gt;So if for the month of September the SUM(Aan klant vergoed) is 50.000 and also the highest of all months, I want the measure to return 50.000.&lt;BR /&gt;Actually I want the month with the highest value of 'Aan klant vergoed' - 'Voor klant verhaald'.&lt;BR /&gt;But already working with one measure gives me trouble.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;HighestSalesMonth = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR EndDate = MAX('FAC_Fraud_Schade'[Datum]) &amp;nbsp;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR StartDate = DATE(YEAR(EndDate) - 1, MONTH(EndDate), DAY(EndDate)) &amp;nbsp;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR SalesTable = FILTER('FAC_Fraud_Schade','FAC_Fraud_Schade'[Datum] &amp;gt;= StartDate &amp;amp;&amp;amp; 'FAC_Fraud_Schade'[Datum] &amp;lt;= EndDate)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR SalesPerMonth = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; SUMMARIZE(SalesTable, 'Date'[Year], 'Date'[Month Name Short],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "MaxSalesPerMonth", SUM('FAC_Fraud_Schade'[Aan klant vergoed])) &amp;nbsp;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;--VAR MaxSales = MAXX(SalesPerMonth, [MaxSalesPerMonth]) &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;VAR MaxSales = CALCULATE(MAX(SalesPerMonth'MaxSalesPerMonth', ALL(SalesPerMonth) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;RETURN&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; MaxSales&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;It gives the error here&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PS I want the highest value, so that I can give, by using conditonal formatting, the highest value a color. So if SUM Klant Vergoed is the measure, I want in additional column the value 3.712.000 , being the highest month value of the last 13 months in my dataset&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;I hope someone can help&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Ron&lt;BR /&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="434309" data-lia-user-login="eliasayyy" class="lia-mention lia-mention-user"&gt;eliasayyy&lt;/a&gt;&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;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Aug 2023 08:40:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3370959#M126847</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-09T08:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the month with the highest number?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3371866#M126892</link>
      <description>&lt;P&gt;hmm this look tricky i made a sample dataset&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;and a caleendar tabel&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;first i created the measure for per month - year&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Amount by month = 

    CALCULATE(SUM('Table'[Amount]),ALLEXCEPT('Date','Date'[Month - Year]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;next i made a measure to find the past 13 months&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Locate past 13 month = 
VAR _min = EOMONTH(CALCULATE(MAX('Date'[Date]),ALL('Date')),-13)
VAR _max = CALCULATE(MAX('Date'[Date]),ALL('Date'))
RETURN
if( MIN('Date'[Date]) &amp;gt;=_min &amp;amp;&amp;amp; MAX('Date'[Date]) &amp;lt;=_max , 1 , 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;next i made a measure to find the maxx inside this window&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Max Amount = 
VAR _t = 
SUMMARIZE(
    FILTER(
        'Date',[Locate past 13 month] = 1),'Date'[Month - Year],"Amount",[Total Amount by month])
RETURN
MAXX(_t,[Amount])&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;and if you want the columsn to show last results just use&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MAX Amount = 
VAR MaxValue =
    CALCULATE(
        MAXX(
            FILTER(
                ALL('Table'),
                'Table'[Locate past 13 month] = 1
            ),
            [Total Amount by month]
        )
    )
RETURN
    MaxValue&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;final result&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;</description>
      <pubDate>Wed, 09 Aug 2023 09:00:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3371866#M126892</guid>
      <dc:creator>eliasayyy</dc:creator>
      <dc:date>2023-08-09T09:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the month with the highest number?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3372076#M126914</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="434309" data-lia-user-login="eliasayyy" class="lia-mention lia-mention-user"&gt;eliasayyy&lt;/a&gt;&amp;nbsp;thnx for the great effort. Somewhere this week, hopefully asap, I will test it on my dataset and then let you know.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 11:22:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3372076#M126914</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-09T11:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the month with the highest number?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3382249#M127446</link>
      <description>&lt;P&gt;Thnx &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="434309" data-lia-user-login="eliasayyy" class="lia-mention lia-mention-user"&gt;eliasayyy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I got it working. Understand what you are doing, but still fin dit hard to find out myself.&lt;BR /&gt;The issue her of course is also that you don't want the MAX of the whole dataset, but just the MAX of the last 13 months, while the dataset contains 4 years of data.&lt;BR /&gt;Thnx for helping me out&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 08:20:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-month-with-the-highest-number/m-p/3382249#M127446</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-16T08:20:54Z</dc:date>
    </item>
  </channel>
</rss>

