<?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 Sales last 3 months and Sparkline in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4706952#M180273</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please &lt;STRONG&gt;accept it as a solution&lt;/STRONG&gt; and give it a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;' so other community members with similar problems can find a solution faster.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 26 May 2025 07:30:59 GMT</pubDate>
    <dc:creator>v-venuppu</dc:creator>
    <dc:date>2025-05-26T07:30:59Z</dc:date>
    <item>
      <title>Average Sales last 3 months and Sparkline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4694852#M179809</link>
      <description>&lt;P&gt;I would like to add a column into a matrix visual that shows me the average monthly sales for the last 3 months based on a month selection. The month selection is based on a slicer.&lt;/P&gt;&lt;P&gt;The challenge is our calendar is a fiscal calendar. In the same calendar I have these columns:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Year&lt;/LI&gt;&lt;LI&gt;Week&lt;/LI&gt;&lt;LI&gt;Month&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;How can I define a measure that will show the AVG weekly sales for the previous 3 months.&lt;/P&gt;&lt;P&gt;But also I want to have a sparkline that will have the months on the x-axes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would you define the dax measure?&lt;/P&gt;&lt;P&gt;This is not working with a fiscal calendar:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;AverageSalesLast3Months = 
CALCULATE(
    AVERAGE(Sales[SalesAmount]),
    DATESINPERIOD(Calendar[Date], MAX(Calendar[Date]), -3, MONTH)
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 15 May 2025 18:17:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4694852#M179809</guid>
      <dc:creator>joshua1990</dc:creator>
      <dc:date>2025-05-15T18:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Average Sales last 3 months and Sparkline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4695153#M179819</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/92006" target="_self"&gt;&lt;SPAN class=""&gt;joshua1990&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As per my understand and with sample data , I tried to implement the solution for you.&lt;BR /&gt;Please find the attached pbix file:&lt;BR /&gt;&lt;A href="https://cloudbiexpert-my.sharepoint.com/:u:/p/maruthi/Ef1Sq9IMm8dHnHyR7GTX9MYBt-iZeoj7cw_E0BsZZfQnDA?e=g5CmnY" target="_blank" rel="noopener"&gt;Average Sales last 3 months and Sparkline.pbix&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have further questions.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If this reply helped solve your problem, please consider clicking "Accept as Solution" so others can benefit too.&amp;nbsp;And if you found it useful, a quick "Kudos" is always appreciated, thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maruthi&amp;nbsp;&lt;/P&gt;&lt;P&gt;LinkedIn -&amp;nbsp;&lt;A href="http://www.linkedin.com/in/maruthi-siva-prasad/" target="_blank" rel="nofollow noopener noreferrer"&gt;http://www.linkedin.com/in/maruthi-siva-prasad/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X&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;A href="https://x.com/maruthisp" target="_blank" rel="nofollow noopener noreferrer"&gt;Maruthi Siva Prasad - (@MaruthiSP) / X&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 03:22:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4695153#M179819</guid>
      <dc:creator>maruthisp</dc:creator>
      <dc:date>2025-05-16T03:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Average Sales last 3 months and Sparkline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4695253#M179821</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="526044" data-lia-user-login="maruthisp" class="lia-mention lia-mention-user"&gt;maruthisp&lt;/a&gt;&amp;nbsp;for the Prompt Response.&lt;/P&gt;
&lt;P&gt;Here’s a solution that respects a fiscal calendar. First, create a FiscalMonthIndex column in your Calendar table:&lt;/P&gt;
&lt;P&gt;FiscalMonthIndex = Calendar[FiscalYear] * 100 + Calendar[FiscalMonthNumber]&lt;/P&gt;
&lt;P&gt;Then, use this measure:&lt;/P&gt;
&lt;P&gt;AverageSalesLast3FiscalMonths =&lt;BR /&gt;VAR SelectedMonthIndex = MAX ( Calendar[FiscalMonthIndex] )&lt;BR /&gt;VAR Last3Months =&lt;BR /&gt;FILTER (&lt;BR /&gt;ALL ( Calendar ),&lt;BR /&gt;Calendar[FiscalMonthIndex] &amp;lt;= SelectedMonthIndex&lt;BR /&gt;&amp;amp;&amp;amp; Calendar[FiscalMonthIndex] &amp;gt; SelectedMonthIndex - 3&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE (&lt;BR /&gt;AVERAGEX (&lt;BR /&gt;VALUES ( Calendar[FiscalMonthIndex] ),&lt;BR /&gt;CALCULATE ( SUM ( Sales[SalesAmount] ) )&lt;BR /&gt;),&lt;BR /&gt;Last3Months&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;This will correctly average sales for the last 3 fiscal months based on the slicer selection. For the sparkline, use FiscalMonth on the x-axis and ensure it's sorted by FiscalMonthIndex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting as solution&amp;nbsp;to help the other members find it more quickly,&amp;nbsp;don't forget to give a&amp;nbsp;"Kudos"&amp;nbsp;– I’d truly appreciate it!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;SPAN data-teams="true"&gt;Thank you.&lt;/SPAN&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 10:36:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4695253#M179821</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-05-19T10:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Average Sales last 3 months and Sparkline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4698276#M179962</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 10:37:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4698276#M179962</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-05-19T10:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Average Sales last 3 months and Sparkline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4702799#M180120</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 06:04:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4702799#M180120</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-05-22T06:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Average Sales last 3 months and Sparkline</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4706952#M180273</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92006" data-lia-user-login="joshua1990" class="lia-mention lia-mention-user"&gt;joshua1990&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please &lt;STRONG&gt;accept it as a solution&lt;/STRONG&gt; and give it a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;' so other community members with similar problems can find a solution faster.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 07:30:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Average-Sales-last-3-months-and-Sparkline/m-p/4706952#M180273</guid>
      <dc:creator>v-venuppu</dc:creator>
      <dc:date>2025-05-26T07:30:59Z</dc:date>
    </item>
  </channel>
</rss>

