<?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: Measure: return the max average(by months) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2254012#M54381</link>
    <description>&lt;P&gt;Looks like it works. Thank you very much.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Dec 2021 16:31:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-12-23T16:31:58Z</dc:date>
    <item>
      <title>Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2252084#M54251</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've started with Power BI a week ago. I found that was the perfect tool for what i was asked for.&lt;/P&gt;&lt;P&gt;I've been chosen to get the time measures of the processes of my company. The metric chosen has been the Lead Time. For each item there is a Lead Time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each item must be categorized in a product catalog. Then the metricts will be shown by product:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only metric that I havent been able to calculate with Power BI desktop is LT_average_max. I want to get the &lt;STRONG&gt;value of the average of the month with the highest (or lowest) average&lt;/STRONG&gt;. At the moment I am using and aux matrix summarizing the averages by product and by month, and them I've to copy all manually to anothe table for the presentations (very arcaic).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Taking in account my researchs, I guess that the optimal way to get this value is by using a measure. But at the moment I can only write very simple functions and I'm not ready to solve this problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Is this measure feasible or should I look for a work around?&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;In case the measure is feasible, could somebody help to formulte it?&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advanced for trying to help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.D. This is my first post. If you have found points on which I can improve, I would be grateful if you could point them out to me .&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 13:55:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2252084#M54251</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-22T13:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2252334#M54268</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;Something like&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LT_Average_max = 
MAXX(
    VALUES(Table[month]),
    AVERAGE(Table[Lead Time])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 15:51:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2252334#M54268</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-12-22T15:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2252485#M54282</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="150936" data-lia-user-login="PaulOlding" class="lia-mention lia-mention-user"&gt;PaulOlding&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;This solution gives me the same solution as the annual average. The measure that I am looking for should calculate the LT for each month and provide the maximum value. In the table attached, LT_Average_min = 18,92 (I need the lowest btw, but it does not affect).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Thank you in any case.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 17:22:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2252485#M54282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-22T17:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2252493#M54284</link>
      <description>&lt;P&gt;I think to help any further I would need some example data and the result you're expecting from that.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 17:28:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2252493#M54284</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-12-22T17:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2253417#M54351</link>
      <description>&lt;P&gt;I've made a sample in which three tables are shown.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Sample data&lt;/LI&gt;&lt;LI&gt;Summary&lt;/LI&gt;&lt;LI&gt;Summary_by_Year_Product (Pivot table)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can access the table through this link:&amp;nbsp;&lt;A href="https://redwoodam-my.sharepoint.com/:x:/g/personal/fernando_guijarro_redwoodcorp_com/EcHAsHJcOMdJvDX50_XhkQsBW8lU3yonnBUl88jz5QV_KA?e=m2kta0" target="_blank"&gt;data example.xlsx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The pasword is:&lt;/P&gt;&lt;P&gt;Power_BI&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 09:22:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2253417#M54351</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-23T09:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2253912#M54377</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; can you try the above?&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;avgByProdMaxYear = 
CALCULATE (
    AVERAGE ( 'Sample'[LT] ),
    VAR _base =
        GROUPBY (
            'Sample',
            'Sample'[Product],
            'Sample'[Year],
            "avg", AVERAGEX ( CURRENTGROUP (), 'Sample'[LT] )
        )
    VAR _rank =
        SUMMARIZE (
            FILTER (
                ADDCOLUMNS (
                    _base,
                    "rank", RANKX ( FILTER ( _base, [Product] = EARLIER ( [Product] ) ), [avg],, DESC )
                ),
                [rank] = 1
            ),
            'Sample'[Product],
            'Sample'[Year]
        )
    RETURN
        _rank
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 15:25:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2253912#M54377</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-12-23T15:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2254012#M54381</link>
      <description>&lt;P&gt;Looks like it works. Thank you very much.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 16:31:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2254012#M54381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-23T16:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2254055#M54383</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; while this works, I want to leave you with a more elegant 1 line measure. Pbix is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;_top1Average =
CALCULATE (
    [average],
    KEEPFILTERS ( TOPN ( 1, ALLSELECTED ( Sample_data[Year] ), [average], DESC ) )
)
&lt;/LI-CODE&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 17:17:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2254055#M54383</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-12-23T17:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2255245#M54422</link>
      <description>&lt;P&gt;Thank you but this second solution does not work for me. I will try it later when I'll get a bertter understanding of DAX and M.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error that I get is that there is no column [average].&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 12:04:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2255245#M54422</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-24T12:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2255269#M54423</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;please refer to the attached pbix&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 12:39:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2255269#M54423</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-12-24T12:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Measure: return the max average(by months)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2255298#M54424</link>
      <description>&lt;P&gt;Now it works, I didn't know that [average] were a measure. This shows exactly what I'was looking for.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 13:05:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-return-the-max-average-by-months/m-p/2255298#M54424</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-24T13:05:41Z</dc:date>
    </item>
  </channel>
</rss>

