<?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: Average Graph without the Last Month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3738669#M145762</link>
    <description>&lt;P&gt;Dear Ibendlin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your advice.&lt;/P&gt;&lt;P&gt;My problem is that my Dax ability is not good enough to edit the measures. How can I filter the measure?&lt;/P&gt;&lt;P&gt;My graph doesn't have any date filter, it shows all years and months.&lt;/P&gt;&lt;P&gt;Can you help?&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2024 02:08:54 GMT</pubDate>
    <dc:creator>Young_G_Han</dc:creator>
    <dc:date>2024-03-04T02:08:54Z</dc:date>
    <item>
      <title>Average Graph without the Last Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3738576#M145752</link>
      <description>&lt;P&gt;&amp;nbsp; Dear Kudos&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had great help from this community and got many good Dax measures.&lt;BR /&gt;One of them helped me to draw the following average graph.&lt;BR /&gt;I could compare average sales per month year by year.&lt;BR /&gt;But there is one problem with this one: I have much less sales at the beginning of the month than in the previous months.&lt;/P&gt;&lt;P&gt;So the average becomes much less... during the beginning of a year, it affects a lot.&lt;/P&gt;&lt;P&gt;I want to eliminate the latest month from the calculation but I couldn't...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you improve the Dax measure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The measure I used is the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;calculate(averagex(values(date[month]), calculate([sales])), datesytd(endofyear(date[date])))&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;</description>
      <pubDate>Mon, 04 Mar 2024 00:19:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3738576#M145752</guid>
      <dc:creator>Young_G_Han</dc:creator>
      <dc:date>2024-03-04T00:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Average Graph without the Last Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3738654#M145759</link>
      <description>&lt;P&gt;You add a filter that excludes the current month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your formula looks a bit, uhm, elaborate. Recommend you simplify it by using either CALCULATE(AVERAGE()) or AVERAGEX(), but not both together.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 02:03:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3738654#M145759</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-03-04T02:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Average Graph without the Last Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3738669#M145762</link>
      <description>&lt;P&gt;Dear Ibendlin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your advice.&lt;/P&gt;&lt;P&gt;My problem is that my Dax ability is not good enough to edit the measures. How can I filter the measure?&lt;/P&gt;&lt;P&gt;My graph doesn't have any date filter, it shows all years and months.&lt;/P&gt;&lt;P&gt;Can you help?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 02:08:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3738669#M145762</guid>
      <dc:creator>Young_G_Han</dc:creator>
      <dc:date>2024-03-04T02:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Average Graph without the Last Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3798416#M148457</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="173709" data-lia-user-login="Young_G_Han" class="lia-mention lia-mention-user"&gt;Young_G_Han&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Here some steps that I want to share, you can check them if they suitable for your requirement.&lt;BR /&gt;Here is my test data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create a year column&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Year = YEAR('Date'[DATE])&lt;/LI-CODE&gt;
&lt;P&gt;Create a average column&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Average Sales by Year = 
CALCULATE(
    AVERAGE('Date'[Sales]),
    FILTER(
        ALLEXCEPT('Date','Date'[Year]),
        'Date'[DATE] &amp;lt; DATE(2024,2,1)
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;Final outtput&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;Best regards,&lt;/P&gt;
&lt;P&gt;Albert He&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider&lt;EM&gt;&lt;STRONG&gt; Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 29 Mar 2024 08:35:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3798416#M148457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-29T08:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Average Graph without the Last Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3801042#M148610</link>
      <description>&lt;P&gt;&amp;nbsp; Dear v-heq-msft&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the reply.&lt;/P&gt;&lt;P&gt;Because my sales data has the daily sales, the measure returns different result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have changed your measure like below, it was working in the sample BI that you attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Average Sales &lt;/SPAN&gt;&lt;SPAN&gt;by&lt;/SPAN&gt;&lt;SPAN&gt; Year = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;AVERAGE&lt;/SPAN&gt;&lt;SPAN&gt;('Date'[Sales]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN&gt;('Date','Date'[Year]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Date'[DATE] &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;('Date'[DATE])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But in my original BI report, it shows much smaller values since the measure calculates average daily sales in a month.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have to make an average of monthly sales...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Do I have any chance to improve your solution???&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 31 Mar 2024 23:09:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3801042#M148610</guid>
      <dc:creator>Young_G_Han</dc:creator>
      <dc:date>2024-03-31T23:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Average Graph without the Last Month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3803426#M148708</link>
      <description>&lt;P&gt;&amp;nbsp; Dear All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I successfully made a measure that will show the monthly average sales of each year, excluding the latest month.&lt;/P&gt;&lt;P&gt;Why do I need it?&lt;/P&gt;&lt;P&gt;When we are in the middle of a month, the average would be smaller compared to the previous year due to fewer sales of the current month.&lt;/P&gt;&lt;P&gt;So, I used a filter to exclude current month sales, the logic is simple and needs two measures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Before to use this measure, you need to add a column in the DATE table.&lt;/P&gt;&lt;P&gt;YEAR&amp;amp;MONTH = FORMAT(DATE[DATE], "YYYYMM")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daily Sales =&lt;BR /&gt;CALCULATE(SUMX(DATA, DATA[VALUE]), FILTER(DATE, DATE[YEAR&amp;amp;MONTH] &amp;lt;&amp;gt; FORMAT(TODAY(), "YYYYMM")))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then&lt;/P&gt;&lt;P&gt;Average Month =&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'_DATE'&lt;/SPAN&gt;&lt;SPAN&gt;[YEAR&amp;amp;MONTH]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;FORMAT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;(), &lt;/SPAN&gt;&lt;SPAN&gt;"YYYYMM"&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;BLANK&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;(VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'_DATE'&lt;/SPAN&gt;&lt;SPAN&gt;[MONTH]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Daily Sales]&lt;/SPAN&gt;&lt;SPAN&gt;)),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DATESYTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ENDOFYEAR&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'_DATE'&lt;/SPAN&gt;&lt;SPAN&gt;[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This will show the average sales per month in each year.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Cheers for users!&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Apr 2024 02:49:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Graph-without-the-Last-Month/m-p/3803426#M148708</guid>
      <dc:creator>Young_G_Han</dc:creator>
      <dc:date>2024-04-02T02:49:27Z</dc:date>
    </item>
  </channel>
</rss>

