<?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: retrieving average value for base year, by segments in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4249580#M168257</link>
    <description>&lt;P&gt;Thanks Ibedlin ! That works for calculating the Avg in year by Category (in this case post code).&amp;nbsp; But what about calculating the % change from 2019 Avg by Category ?&amp;nbsp; In the attached this didn't pull back correct values ? using :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calc % vs &lt;/SPAN&gt;&lt;SPAN&gt;2019&lt;/SPAN&gt;&lt;SPAN&gt; Avg = &lt;/SPAN&gt;&lt;SPAN&gt;divide&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;average&lt;/SPAN&gt;&lt;SPAN&gt;(Sheet1[value]),[Calc 2019 Avg])-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dp_75&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/scl/fi/kvtskvaur4ln37t8n7hob/power-BI-sample.pbix?rlkey=zu1hr8in8kqj7p96l8h3gnmtp&amp;amp;st=fgxxdfm1&amp;amp;dl=0" target="_self"&gt;https://www.dropbox.com/scl/fi/kvtskvaur4ln37t8n7hob/power-BI-sample.pbix?rlkey=zu1hr8in8kqj7p96l8h3gnmtp&amp;amp;st=fgxxdfm1&amp;amp;dl=0&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sun, 20 Oct 2024 12:27:32 GMT</pubDate>
    <dc:creator>dp_75</dc:creator>
    <dc:date>2024-10-20T12:27:32Z</dc:date>
    <item>
      <title>retrieving average value for base year, by segments</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4248837#M168231</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Can anyone help with a query related to my previous one...trying to retrieve a calculated average value for a base year,&amp;nbsp; next to the selected later dates, and to be compatible with filters and selections.&amp;nbsp; eg. For compare Aug-24 Average value to Average Value for Aug-19, or for Jan-Aug 2024 Average compared to Average for Jan-Aug 2019, and to pull the same for Category (in this case the poast code)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See sample .pbix and data:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/scl/fi/kvtskvaur4ln37t8n7hob/power-BI-sample.pbix?rlkey=zu1hr8in8kqj7p96l8h3gnmtp&amp;amp;st=k81su0cq&amp;amp;dl=0" target="_blank"&gt;https://www.dropbox.com/scl/fi/kvtskvaur4ln37t8n7hob/power-BI-sample.pbix?rlkey=zu1hr8in8kqj7p96l8h3gnmtp&amp;amp;st=k81su0cq&amp;amp;dl=0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the following DAX brings back the correct 2019 Avg value for a month (but not a period eg Jan-Aug 2019), and also brings out a constant value by post code ? (see below picture)&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calc &lt;/SPAN&gt;&lt;SPAN&gt;2019&lt;/SPAN&gt;&lt;SPAN&gt; Avg = &lt;/SPAN&gt;&lt;SPAN&gt;AVERAGEX&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(Sheet1),Sheet1[year]=&lt;/SPAN&gt;&lt;SPAN&gt;2019&lt;/SPAN&gt;&lt;SPAN&gt;&amp;amp;&amp;amp;Sheet1[month]=&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(Sheet1[month])),[Value]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&amp;nbsp;Many thanks for your help !&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DP_75&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2024 21:29:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4248837#M168231</guid>
      <dc:creator>dp_75</dc:creator>
      <dc:date>2024-10-18T21:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving average value for base year, by segments</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4249142#M168237</link>
      <description>&lt;P&gt;If you want to do date math you will want to add a calendar table to your data model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Calc 2019 Avg = var yd = 2019-max('Calendar'[Year]) return CALCULATE(AVERAGE(Sheet1[value]),DATEADD('Calendar'[Date],yd,YEAR))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;see attached.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2024 14:23:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4249142#M168237</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-19T14:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving average value for base year, by segments</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4249580#M168257</link>
      <description>&lt;P&gt;Thanks Ibedlin ! That works for calculating the Avg in year by Category (in this case post code).&amp;nbsp; But what about calculating the % change from 2019 Avg by Category ?&amp;nbsp; In the attached this didn't pull back correct values ? using :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Calc % vs &lt;/SPAN&gt;&lt;SPAN&gt;2019&lt;/SPAN&gt;&lt;SPAN&gt; Avg = &lt;/SPAN&gt;&lt;SPAN&gt;divide&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;average&lt;/SPAN&gt;&lt;SPAN&gt;(Sheet1[value]),[Calc 2019 Avg])-&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dp_75&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.dropbox.com/scl/fi/kvtskvaur4ln37t8n7hob/power-BI-sample.pbix?rlkey=zu1hr8in8kqj7p96l8h3gnmtp&amp;amp;st=fgxxdfm1&amp;amp;dl=0" target="_self"&gt;https://www.dropbox.com/scl/fi/kvtskvaur4ln37t8n7hob/power-BI-sample.pbix?rlkey=zu1hr8in8kqj7p96l8h3gnmtp&amp;amp;st=fgxxdfm1&amp;amp;dl=0&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 20 Oct 2024 12:27:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4249580#M168257</guid>
      <dc:creator>dp_75</dc:creator>
      <dc:date>2024-10-20T12:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving average value for base year, by segments</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4249710#M168266</link>
      <description>&lt;P&gt;which values do you think are incorrect?&amp;nbsp; Remember that 2024 isn't complete yet.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Oct 2024 21:04:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4249710#M168266</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-20T21:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving average value for base year, by segments</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4252399#M168411</link>
      <description>&lt;P&gt;Thanks Ibendlin - solution works for comparing years to 2019 base year, but as you say will not work for part year 2024.&amp;nbsp; Will need another solution to detected year to date 2024 data and compare to same year to date position for 2019, or full 2019 base year.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 09:58:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4252399#M168411</guid>
      <dc:creator>dp_75</dc:creator>
      <dc:date>2024-10-22T09:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving average value for base year, by segments</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4252594#M168423</link>
      <description>&lt;P&gt;My solution works for YTD - that should be acceptable.&amp;nbsp; No point in comparing partial 2024 to full 2019.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2024 12:42:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/retrieving-average-value-for-base-year-by-segments/m-p/4252594#M168423</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-10-22T12:42:36Z</dc:date>
    </item>
  </channel>
</rss>

