<?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 Calculate average between 2 columns, per year. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215088#M117368</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have 3 columns.&lt;BR /&gt;- System Power&lt;/P&gt;&lt;P&gt;- Power&lt;/P&gt;&lt;P&gt;- Year&lt;/P&gt;&lt;P&gt;All in the same table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I want to calculate the average difference between System Power and Power, visualise the difference per year.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How should I do it?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've tried using formulas like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Average Difference by Forecast Year =
AVERAGEX(
    VALUES('Data'[Year]),
    CALCULATE(
        AVERAGE('Data'[System Power]) - AVERAGE('Data'[Power])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Also tried to make a new column called: "Power Difference" where I used M-code:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[#"System Power"] - [#"Power"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I tried to use average on it but I only get the same value over all the years:&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;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 07:55:14 GMT</pubDate>
    <dc:creator>fraitaan</dc:creator>
    <dc:date>2023-05-02T07:55:14Z</dc:date>
    <item>
      <title>Calculate average between 2 columns, per year.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215088#M117368</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have 3 columns.&lt;BR /&gt;- System Power&lt;/P&gt;&lt;P&gt;- Power&lt;/P&gt;&lt;P&gt;- Year&lt;/P&gt;&lt;P&gt;All in the same table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I want to calculate the average difference between System Power and Power, visualise the difference per year.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How should I do it?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've tried using formulas like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Average Difference by Forecast Year =
AVERAGEX(
    VALUES('Data'[Year]),
    CALCULATE(
        AVERAGE('Data'[System Power]) - AVERAGE('Data'[Power])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Also tried to make a new column called: "Power Difference" where I used M-code:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[#"System Power"] - [#"Power"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I tried to use average on it but I only get the same value over all the years:&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;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 07:55:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215088#M117368</guid>
      <dc:creator>fraitaan</dc:creator>
      <dc:date>2023-05-02T07:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average between 2 columns, per year.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215229#M117370</link>
      <description>&lt;P&gt;hello please try&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;average difference by year = 
VAR avgp = CALCULATE(AVERAGE('Table'[Power]),ALLEXCEPT('Table','Table'[Year]))
VAR avgsp = CALCULATE(AVERAGE('Table'[System Power]),ALLEXCEPT('Table','Table'[Year]))
VAR diff = avgp - avgsp
RETURN
AVERAGEX(VALUES('Table'[Year]),diff)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 May 2023 08:57:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215229#M117370</guid>
      <dc:creator>eliasayyy</dc:creator>
      <dc:date>2023-05-02T08:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average between 2 columns, per year.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215295#M117374</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for answer&lt;BR /&gt;&lt;BR /&gt;Still got the same value over all years&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I need to see the difference between each year.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 09:29:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215295#M117374</guid>
      <dc:creator>fraitaan</dc:creator>
      <dc:date>2023-05-02T09:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average between 2 columns, per year.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215399#M117380</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="435705" data-lia-user-login="fraitaan" class="lia-mention lia-mention-user"&gt;fraitaan&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please make sure to use a year column which is in the same table or in a dimension table that filters this table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 10:13:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215399#M117380</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-05-02T10:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate average between 2 columns, per year.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215544#M117390</link>
      <description>&lt;P&gt;as&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;stated, do you have a seperate table for year? or what did you include in the column chart which column&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 11:47:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-average-between-2-columns-per-year/m-p/3215544#M117390</guid>
      <dc:creator>eliasayyy</dc:creator>
      <dc:date>2023-05-02T11:47:19Z</dc:date>
    </item>
  </channel>
</rss>

