<?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: Dynamic Average per month Calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4804397#M183775</link>
    <description>&lt;P&gt;To calculate daily average power usage for the same month last year based on any date selection:&lt;BR /&gt;Detect the selected date(s).&lt;BR /&gt;Shift to the same month in the previous year.&lt;BR /&gt;Sum power usage for that month.&lt;BR /&gt;Divide by number of days in that month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DailyAvgPower_LastYearMonth =&lt;BR /&gt;VAR SelectedMonth = MONTH(MIN('DateTable'[Date]))&lt;BR /&gt;VAR SelectedYear = YEAR(MIN('DateTable'[Date])) - 1&lt;BR /&gt;VAR DatesLastYear = FILTER(&lt;BR /&gt;ALL('DateTable'),&lt;BR /&gt;MONTH('DateTable'[Date]) = SelectedMonth &amp;amp;&amp;amp;&lt;BR /&gt;YEAR('DateTable'[Date]) = SelectedYear&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;DIVIDE(&lt;BR /&gt;CALCULATE(SUM(PowerUsage[Usage]), DatesLastYear),&lt;BR /&gt;CALCULATE(DISTINCTCOUNT('DateTable'[Date]), DatesLastYear)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Fri, 22 Aug 2025 03:52:35 GMT</pubDate>
    <dc:creator>Shahid12523</dc:creator>
    <dc:date>2025-08-22T03:52:35Z</dc:date>
    <item>
      <title>Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4788846#M183321</link>
      <description>&lt;P&gt;Hi Power Bi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a Power Usage column(hourly data), date table from last Year till today and I want to calculate the daily average power for a month and every month will have a different average and when i select any day or multiple days from the current month or previous month from the date slicer it should return that particular month last year daily average value. User can select 1 day or 2 day or week, month, Year depending on the selection it should return the average for that period and if the user selects one day then also it should return same month last year daily average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Instance if i select 5th Aug 25 then it should return same month last year daily average.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daily Average Calculation = SUM(Individual days Power)/Total no.of days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know how i can achieve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Ibrahim.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 11:29:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4788846#M183321</guid>
      <dc:creator>Ibrahim_shaik</dc:creator>
      <dc:date>2025-08-06T11:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4788916#M183324</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="509602" data-lia-user-login="Ibrahim_shaik" class="lia-mention lia-mention-user"&gt;Ibrahim_shaik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ensure you have a separate date table in your model. T&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Make sure your date table is related to your power usage data table through the date column.&lt;/P&gt;
&lt;P&gt;You can create a measure to calculate the daily average power usage for the selected period.&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;DailyAveragePower = &lt;BR /&gt;VAR SelectedDays = COUNTROWS(VALUES('DateTable'[Date]))&lt;BR /&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;SelectedDays &amp;gt; 0,&lt;BR /&gt;DIVIDE(SUM('PowerUsageTable'[PowerUsage]), SelectedDays),&lt;BR /&gt;BLANK()&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a Measure for Last Year's Daily Average: This measure will calculate the daily average for the same month in the previous year.&lt;/P&gt;
&lt;P&gt;LastYearDailyAveragePower = &lt;BR /&gt;VAR CurrentMonth = MONTH(SELECTEDVALUE('DateTable'[Date]))&lt;BR /&gt;VAR CurrentYear = YEAR(SELECTEDVALUE('DateTable'[Date]))&lt;BR /&gt;VAR LastYear = CurrentYear - 1&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[DailyAveragePower],&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('DateTable'),&lt;BR /&gt;MONTH('DateTable'[Date]) = CurrentMonth &amp;amp;&amp;amp;&lt;BR /&gt;YEAR('DateTable'[Date]) = LastYear&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 12:09:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4788916#M183324</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-08-06T12:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4791034#M183394</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="509602" data-lia-user-login="Ibrahim_shaik" class="lia-mention lia-mention-user"&gt;Ibrahim_shaik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming you have a claendar table and relationship with corresponding fact table.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Previous Year Average =
var selecteddates=values('Calendar'[Date])
var preYeardates=SELECTCOLUMNS(ADDCOLUMNS('Calendar',"prevyerdate",DATE(year('Calendar'[Date])-1,MONTH('Calendar'[Date]),DAY('Calendar'[Date]))),"Date",[prevyerdate])
return
CALCULATE(DailyAverage,TREATAS(preYeardates,'Calendar'[Date]))&lt;/LI-CODE&gt;&lt;P&gt;DailyAverage is nothing but the formula you already mentioned.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Daily Average Calculation = SUM(Individual days Power)/Total no.of days.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Hope this works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2025 09:17:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4791034#M183394</guid>
      <dc:creator>sreejad</dc:creator>
      <dc:date>2025-08-08T09:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4795629#M183534</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="509602" data-lia-user-login="Ibrahim_shaik" class="lia-mention lia-mention-user"&gt;Ibrahim_shaik&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Just wanted to check if you got a chance to review the suggestions provided and whether that helped you resolve your query?&lt;BR /&gt;&lt;BR /&gt;Thank You&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 10:12:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4795629#M183534</guid>
      <dc:creator>v-sdhruv</dc:creator>
      <dc:date>2025-08-13T10:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4795824#M183536</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1249533" data-lia-user-login="v-sdhruv" class="lia-mention lia-mention-user"&gt;v-sdhruv&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the late response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for providing the solution. I will try this measure and will let you know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you once again.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 12:54:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4795824#M183536</guid>
      <dc:creator>Ibrahim_shaik</dc:creator>
      <dc:date>2025-08-13T12:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4795825#M183537</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1315651" data-lia-user-login="sreejad" class="lia-mention lia-mention-user"&gt;sreejad&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the solution.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2025 12:56:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4795825#M183537</guid>
      <dc:creator>Ibrahim_shaik</dc:creator>
      <dc:date>2025-08-13T12:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4801887#M183705</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/509602" target="_blank"&gt;@Ibrahim_shaik&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;Just wanted to check if you got a chance to review the suggestions provided and whether that helped you resolve your query?&lt;BR /&gt;&lt;BR /&gt;Thank You&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Aug 2025 07:11:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4801887#M183705</guid>
      <dc:creator>v-sdhruv</dc:creator>
      <dc:date>2025-08-20T07:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4804397#M183775</link>
      <description>&lt;P&gt;To calculate daily average power usage for the same month last year based on any date selection:&lt;BR /&gt;Detect the selected date(s).&lt;BR /&gt;Shift to the same month in the previous year.&lt;BR /&gt;Sum power usage for that month.&lt;BR /&gt;Divide by number of days in that month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DailyAvgPower_LastYearMonth =&lt;BR /&gt;VAR SelectedMonth = MONTH(MIN('DateTable'[Date]))&lt;BR /&gt;VAR SelectedYear = YEAR(MIN('DateTable'[Date])) - 1&lt;BR /&gt;VAR DatesLastYear = FILTER(&lt;BR /&gt;ALL('DateTable'),&lt;BR /&gt;MONTH('DateTable'[Date]) = SelectedMonth &amp;amp;&amp;amp;&lt;BR /&gt;YEAR('DateTable'[Date]) = SelectedYear&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;DIVIDE(&lt;BR /&gt;CALCULATE(SUM(PowerUsage[Usage]), DatesLastYear),&lt;BR /&gt;CALCULATE(DISTINCTCOUNT('DateTable'[Date]), DatesLastYear)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 22 Aug 2025 03:52:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4804397#M183775</guid>
      <dc:creator>Shahid12523</dc:creator>
      <dc:date>2025-08-22T03:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4806713#M183846</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="509602" data-lia-user-login="Ibrahim_shaik" class="lia-mention lia-mention-user"&gt;Ibrahim_shaik&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I hope your query got resolved. Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1265350" data-lia-user-login="Shahid12523" class="lia-mention lia-mention-user"&gt;Shahid12523&lt;/a&gt;&amp;nbsp; for sharing your input.&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;We would be closing this thread, if you still need any assistance, feel free to reach out by creating a new post.&lt;BR /&gt;&lt;BR /&gt;Thank you for using Microsoft Community Forum&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 11:13:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4806713#M183846</guid>
      <dc:creator>v-sdhruv</dc:creator>
      <dc:date>2025-08-25T11:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4806767#M183850</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1249533" data-lia-user-login="v-sdhruv" class="lia-mention lia-mention-user"&gt;v-sdhruv&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1265350" data-lia-user-login="Shahid12523" class="lia-mention lia-mention-user"&gt;Shahid12523&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for late response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for providing the solution&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1265350" data-lia-user-login="Shahid12523" class="lia-mention lia-mention-user"&gt;Shahid12523&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My query is resolved.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 11:39:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4806767#M183850</guid>
      <dc:creator>Ibrahim_shaik</dc:creator>
      <dc:date>2025-08-25T11:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Average per month Calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4806773#M183851</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="509602" data-lia-user-login="Ibrahim_shaik" class="lia-mention lia-mention-user"&gt;Ibrahim_shaik&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Can you please mark it as a solution so that other users can also benefit from it.&lt;BR /&gt;Thank you for using Microsoft Community Forum&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 11:42:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dynamic-Average-per-month-Calculation/m-p/4806773#M183851</guid>
      <dc:creator>v-sdhruv</dc:creator>
      <dc:date>2025-08-25T11:42:14Z</dc:date>
    </item>
  </channel>
</rss>

