<?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: Bar chart with the last 12 months and the total average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4611978#M176520</link>
    <description>&lt;P&gt;as mentioned by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;you could include a average line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg Amount = 
AVERAGEX(
    ALLSELECTED( 'dates'[Year Month] )
    ,[Amount]
)&lt;/LI-CODE&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;If you really want that extra bar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a date dimension&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;dates = 
ADDCOLUMNS(
    CALENDARAUTO()
    ,"Year", YEAR( [Date] )
    ,"Year Month", EOMONTH( [Date] ,0 )
    ,"Year Month No", (YEAR( [Date] ) * 100) + MONTH( [Date] )
    ,"Month", MONTH( [Date] )
)&lt;/LI-CODE&gt;&lt;P&gt;and a table for the axis&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;xAxis = 
UNION(
    SELECTCOLUMNS(
        SUMMARIZE( 'dates', 'dates'[Year Month], dates[Year Month No] )
        ,"Index", dates[Year Month No]
        ,"Label", FORMAT( dates[Year Month], "mm/yyyy" )
        ,"Hex", "#0f3057"
    )
    ,ROW( "Index", 999999, "Lebel", "Average", "Hex", "#604e82" )
)&lt;/LI-CODE&gt;&lt;P&gt;Added a mesure for the y axis&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Amount With Avg = 
IF( 
    SELECTEDVALUE( xAxis[Label] ) = "Average" 
    ,[Avg Amount]
    ,CALCULATE(
        [Amount]
        ,TREATAS( VALUES( xAxis[Index] ) , dates[Year Month No] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;and a measure for conditional formatting on the bars&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Colour = SELECTEDVALUE( xAxis[Hex] )&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 16 Mar 2025 21:00:42 GMT</pubDate>
    <dc:creator>Deku</dc:creator>
    <dc:date>2025-03-16T21:00:42Z</dc:date>
    <item>
      <title>Bar chart with the last 12 months and the total average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4611856#M176517</link>
      <description>&lt;P&gt;Hello friends,&lt;BR /&gt;Can you tell me how I can achieve the same result as the graph in the image below? I need to create a graph in Power BI where on the X axis I have the last 12 months prior to the month that is being filtered in the data segmentation, the months need to be in the "MM/YYYY" format. On the same X axis I need to have a column for the AVERAGE of these last 12 months.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;When the user filters the month "09/2024" in the segmentation, then the graph should show the last 12 months prior to "09/2024"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Mar 2025 14:06:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4611856#M176517</guid>
      <dc:creator>Rai_Lomarques</dc:creator>
      <dc:date>2025-03-16T14:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Bar chart with the last 12 months and the total average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4611956#M176518</link>
      <description>&lt;P&gt;Showing the same data twice in a visual is a design red flag. Consider using an average line instead of the column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;Do not include sensitive information. Do not include anything that is unrelated to the issue or question. &lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Need help uploading data? &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Mar 2025 19:47:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4611956#M176518</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-03-16T19:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Bar chart with the last 12 months and the total average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4611978#M176520</link>
      <description>&lt;P&gt;as mentioned by&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;you could include a average line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg Amount = 
AVERAGEX(
    ALLSELECTED( 'dates'[Year Month] )
    ,[Amount]
)&lt;/LI-CODE&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;If you really want that extra bar.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a date dimension&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;dates = 
ADDCOLUMNS(
    CALENDARAUTO()
    ,"Year", YEAR( [Date] )
    ,"Year Month", EOMONTH( [Date] ,0 )
    ,"Year Month No", (YEAR( [Date] ) * 100) + MONTH( [Date] )
    ,"Month", MONTH( [Date] )
)&lt;/LI-CODE&gt;&lt;P&gt;and a table for the axis&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;xAxis = 
UNION(
    SELECTCOLUMNS(
        SUMMARIZE( 'dates', 'dates'[Year Month], dates[Year Month No] )
        ,"Index", dates[Year Month No]
        ,"Label", FORMAT( dates[Year Month], "mm/yyyy" )
        ,"Hex", "#0f3057"
    )
    ,ROW( "Index", 999999, "Lebel", "Average", "Hex", "#604e82" )
)&lt;/LI-CODE&gt;&lt;P&gt;Added a mesure for the y axis&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Amount With Avg = 
IF( 
    SELECTEDVALUE( xAxis[Label] ) = "Average" 
    ,[Avg Amount]
    ,CALCULATE(
        [Amount]
        ,TREATAS( VALUES( xAxis[Index] ) , dates[Year Month No] )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;and a measure for conditional formatting on the bars&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Colour = SELECTEDVALUE( xAxis[Hex] )&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Mar 2025 21:00:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4611978#M176520</guid>
      <dc:creator>Deku</dc:creator>
      <dc:date>2025-03-16T21:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Bar chart with the last 12 months and the total average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4613807#M176569</link>
      <description>&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Hi&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 style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;If these also don't help, please share more detailed information and description to help us clarify your scenario to test.&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Regards,&lt;/P&gt;
&lt;P style="margin: 0in; font-family: tahoma; font-size: 11.0pt;"&gt;Xiaoxin Sheng&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 01:31:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4613807#M176569</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-03-18T01:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Bar chart with the last 12 months and the total average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4666257#M178720</link>
      <description>&lt;P&gt;Hi&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;&lt;SPAN data-teams="true"&gt;Has your issue been resolved, or do you require any further information? Your feedback is valuable to us. If the solution was effective, please mark it as '&lt;STRONG&gt;Accepted Solution' &lt;/STRONG&gt;to assist other community members experiencing the same issue.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 08:49:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4666257#M178720</guid>
      <dc:creator>V-yubandi-msft</dc:creator>
      <dc:date>2025-04-24T08:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Bar chart with the last 12 months and the total average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4671399#M178934</link>
      <description>&lt;P&gt;Hi&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;&lt;SPAN data-teams="true"&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 &lt;STRONG&gt;accept it as a solution&lt;/STRONG&gt; and give a &lt;STRONG&gt;'Kudos'&lt;/STRONG&gt; so other members can easily find it.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 15:28:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4671399#M178934</guid>
      <dc:creator>V-yubandi-msft</dc:creator>
      <dc:date>2025-04-28T15:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Bar chart with the last 12 months and the total average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4677368#M179140</link>
      <description>&lt;P&gt;Hi&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;May I ask if you have resolved this issue? If so, please mark the helpful reply and &lt;STRONG&gt;accept it as the solution.&lt;/STRONG&gt; This will be helpful for other community members who have similar problems to solve it faster.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&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>Fri, 02 May 2025 10:30:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Bar-chart-with-the-last-12-months-and-the-total-average/m-p/4677368#M179140</guid>
      <dc:creator>V-yubandi-msft</dc:creator>
      <dc:date>2025-05-02T10:30:51Z</dc:date>
    </item>
  </channel>
</rss>

