<?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: months with dynamic axis in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4718103#M180701</link>
    <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1236158" target="_blank" rel="noopener"&gt;@Rai_Lomarques&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you have gotten this issue resolved?&lt;/P&gt;
&lt;P&gt;If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vinay Pabbu&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jun 2025 09:32:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-06-03T09:32:13Z</dc:date>
    <item>
      <title>months with dynamic axis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4610150#M176467</link>
      <description>&lt;P&gt;I need to create a physical table in Power BI containing the last 12 months prior to the month that is being filtered in the data segmentation and at the end of this table I need to have an average so that I can use it as the X axis of a graph. How can I achieve this?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My goal is to place the months on the X axis of the graph so that it shows the last 12 months in the format "MM/YYYY" and the average.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;See below the expected result:&lt;BR /&gt;&lt;BR /&gt;The example below illustrates that the month '03/2025' is being filtered in the data segmentation, so the table is returning the last 12 months prior to '03/2025'.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I have a table (dCalendar) of dates that is related to other tables&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 23:33:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4610150#M176467</guid>
      <dc:creator>Rai_Lomarques</dc:creator>
      <dc:date>2025-03-14T23:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: months with dynamic axis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4610205#M176470</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1236158" data-lia-user-login="Rai_Lomarques" class="lia-mention lia-mention-user"&gt;Rai_Lomarques&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't already have a date table, you can create one using DAX:&lt;/P&gt;
&lt;P&gt;dCalendar = &lt;BR /&gt;ADDCOLUMNS (&lt;BR /&gt;CALENDAR (DATE(2010, 1, 1), DATE(2030, 12, 31)),&lt;BR /&gt;"Year", YEAR([Date]),&lt;BR /&gt;"Month", MONTH([Date]),&lt;BR /&gt;"MonthYear", FORMAT([Date], "MM/YYYY")&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a measure to calculate the last 12 months based on the selected month:&lt;/P&gt;
&lt;P&gt;Last12Months = &lt;BR /&gt;VAR SelectedMonth = MAX(dCalendar[Date])&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATETABLE (&lt;BR /&gt;dCalendar,&lt;BR /&gt;DATESINPERIOD (&lt;BR /&gt;dCalendar[Date],&lt;BR /&gt;SelectedMonth,&lt;BR /&gt;-12,&lt;BR /&gt;MONTH&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a measure to calculate the average of the values you want to display:&lt;/P&gt;
&lt;P&gt;AverageValue = &lt;BR /&gt;CALCULATE (&lt;BR /&gt;AVERAGE(YourTable[YourValueColumn]),&lt;BR /&gt;FILTER (&lt;BR /&gt;dCalendar,&lt;BR /&gt;dCalendar[Date] IN Last12Months&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a table visual to your report.&lt;BR /&gt;Add the MonthYear column from the dCalendar table to the table visual.&lt;BR /&gt;Add the AverageValue measure to the table visual.&lt;/P&gt;
&lt;P&gt;To format the X axis to show the months in "MM/YYYY" format, ensure that the MonthYear column is used as the X axis in your graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 12:32:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4610205#M176470</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2025-03-14T12:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: months with dynamic axis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4610605#M176486</link>
      <description>&lt;P&gt;Your solution does not address my issue. I need the "Average" on the X axis and your solution does not have it. In the screenshot example I put the sales in the month columns and the average at the end.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 16:34:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4610605#M176486</guid>
      <dc:creator>Rai_Lomarques</dc:creator>
      <dc:date>2025-03-14T16:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: months with dynamic axis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4612338#M176528</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1236158" data-lia-user-login="Rai_Lomarques" class="lia-mention lia-mention-user"&gt;Rai_Lomarques&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I create a set of sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then add a new table:&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;Calendar =
UNION (
    SUMMARIZE (
        SELECTCOLUMNS (
            'Table',
            "YEAR_MONTH", FORMAT ( 'Table'[Month/Date], "MM/YYYY" ),
            "Date",
                CALCULATE (
                    MIN ( 'Table'[Month/Date] ),
                    FILTER (
                        ALLSELECTED ( 'Table' ),
                        MONTH ( 'Table'[Month/Date] ) = MONTH ( EARLIER ( 'Table'[Month/Date] ) )
                            &amp;amp;&amp;amp; YEAR ( 'Table'[Month/Date] ) = YEAR ( EARLIER ( 'Table'[Month/Date] ) )
                    )
                )
        ),
        [YEAR_MONTH],
        [Date]
    ),
    ADDCOLUMNS (
        { "Average" },
        "Date",
            DATE ( YEAR ( MAX ( 'Table'[Month/Date] ) ), MONTH ( MAX ( 'Table'[Month/Date] ) ) + 1, 1 )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Select the YEAR_MONTH Column and click the Sort by column in the Column tools pane then select [Date]:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Finally add a measure:&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;MEASURE =
VAR _currentYear =
    YEAR ( SELECTEDVALUE ( 'Calendar'[Date] ) )
VAR _currentMonth =
    MONTH ( SELECTEDVALUE ( 'Calendar'[Date] ) )
RETURN
    IF (
        SELECTEDVALUE ( 'Calendar'[YEAR_MONTH] ) &amp;lt;&amp;gt; "Average",
        CALCULATE (
            SUM ( 'Table'[Values] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                YEAR ( 'Table'[Month/Date] ) = _currentYear
                    &amp;amp;&amp;amp; MONTH ( 'Table'[Month/Date] ) = _currentMonth
            )
        ),
        CALCULATE ( AVERAGE ( 'Table'[Values] ), ALLSELECTED ( 'Table' ) )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;DIV id="tinyMceEditor_3d431d2fbe49f6vzhengdxumsft_0" class=""&gt;&amp;nbsp;&lt;img /&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;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Mar 2025 07:30:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4612338#M176528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-03-17T07:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: months with dynamic axis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4694002#M179762</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1236158" data-lia-user-login="Rai_Lomarques" class="lia-mention lia-mention-user"&gt;Rai_Lomarques&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you have gotten this issue resolved?&lt;/P&gt;
&lt;P&gt;If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vinay Pabbu&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 10:55:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4694002#M179762</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-15T10:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: months with dynamic axis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4713673#M180542</link>
      <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1236158" target="_blank"&gt;@Rai_Lomarques&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you have gotten this issue resolved?&lt;/P&gt;
&lt;P&gt;If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vinay Pabbu&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 08:52:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4713673#M180542</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-30T08:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: months with dynamic axis</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4718103#M180701</link>
      <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/1236158" target="_blank" rel="noopener"&gt;@Rai_Lomarques&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you have gotten this issue resolved?&lt;/P&gt;
&lt;P&gt;If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Vinay Pabbu&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 09:32:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/months-with-dynamic-axis/m-p/4718103#M180701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-06-03T09:32:13Z</dc:date>
    </item>
  </channel>
</rss>

