<?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: Calculating average on year in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433051#M130186</link>
    <description>&lt;P&gt;With the automatically included date-hierarchy, I don't have the MaandNo, so I tried to include it (column) and then use this in the formula but it doesn't work.&lt;BR /&gt;When I try the formula in the 'old' version (date-table added in a seperate table &amp;amp; linked), my result for average is equal to the sum of all purchases in the month ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe I should start again from the beginning. What is the easiest/best way to include a date-hierarchy? Automatically while loading the rapport (but this seems limited as I only have Year, Quarter, Month, Day) or by adding a independent date-table?&lt;/P&gt;</description>
    <pubDate>Fri, 15 Sep 2023 13:46:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-09-15T13:46:14Z</dc:date>
    <item>
      <title>Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430612#M130049</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as my subject seems very easy to solve, I don't succeed in this. I found already similar topics on this forum and used the formulas mentioned there, but it still doesn't give me the result I need.&lt;BR /&gt;&lt;BR /&gt;I have a table with an overview of all the purchases from our business units to our suppliers, example:&lt;/P&gt;&lt;P&gt;date - business unit 1 - supplier 1 - item 1 - quantity&lt;/P&gt;&lt;P&gt;date - business unit 2 - supplier 1 - item 1 - quantity&lt;/P&gt;&lt;P&gt;date - business unit 1 - supplier 2 - item 2 - quantity&lt;/P&gt;&lt;P&gt;date - business unit 3 - supplier 2 - item 2 - quantity&lt;/P&gt;&lt;P&gt;and so on (you get the picture :)) .. Date can be from the 01/01/2019 until today.&lt;BR /&gt;&lt;BR /&gt;I have made a visual with time dimension (month/year) on the X-as and the quantity on the Y-as.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, if no slicer/filter is activated, I see the total sum of all the quantities purchases, par month.&lt;BR /&gt;If a select a specific business unit, our supplier, our item, the visual changes and shows only the quantities linked to my specific request.&lt;BR /&gt;&lt;BR /&gt;Since our purchases can be very fluctuating, I want to include a 2nd number to the visual and that is the average par year.&amp;nbsp;&lt;BR /&gt;When I use the formula already shared in other topics:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Avg/Year =&lt;/SPAN&gt; &lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;average&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;[Quantity]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;allexcept&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;[Year)]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I have a number that is the same for every date in the same year but it's not correct because:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1. It doesn't change when I select other units/items/.. (the value is fix, no matter which filter/slicer is applied)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2. The numberis to low: I have monthly purchases of 40k, 50k, 20k, 60k, .. (with the lowest being 13k), however my average for that year is 1k.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I think that the formula somehow calculates = sum(quantity) in the whole year / count(quantity) in the whole year but that gives me the average purchase quantity (based on all the orders). I want to have the average purchase quantity based on the quantities par month (so something like = sum(quantity) in year / count(month) in year (can't divide fix by 12 cause I also have the data for 2023 and in that case it should divide by 9 (thats why count makes more sense)).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;The green fields are the quantities for every month, the blue line is the average on year but you see that it's not calculated correct. (average in 2022 of 1100 for monthly purchases of 40K, 60k, ..).&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;So I started making 2 measures, 1 for the sum of the quantity in the year:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sum Year =&lt;/SPAN&gt; &lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;[Quantity]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Jaar]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;and 1 for the count of the months in the year:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Count Months =&lt;/SPAN&gt; &lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;count&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Maand]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;[Jaar]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Sadly, that doesn't work either, as Sum Year is, once again, a fix value (no matter which business unit, supplier, ... I chose), and the Count Months gives me a also a fix result of 365 (except the year 2020, where I have 366).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I can't believe that what I want to achieve is that difficult, so I guess I'm doing just some silly things.&lt;BR /&gt;&lt;BR /&gt;Many thanks,&lt;BR /&gt;Best regards,&lt;BR /&gt;Immanuel&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Sep 2023 10:01:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430612#M130049</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-14T10:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430654#M130055</link>
      <description>&lt;P&gt;You might require the following measures-&lt;/P&gt;&lt;P&gt;Avg of sum = Calculate (averageX(values(Purchases_All[Year]) , calculate(Sum(Purchases_All[Quantity]))), all( Purchases_All[Year]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Avg of sum = Calculate (averageX(values(Purchases_All[Month Year]) , calculate(Sum(Purchases_All[Quantity]))), allexcept(Purchases_All, Purchases_All[Year]))&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 10:08:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430654#M130055</guid>
      <dc:creator>nirali_arora</dc:creator>
      <dc:date>2023-09-14T10:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430676#M130059</link>
      <description>&lt;P&gt;something like:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;avg quantity =
VAR count_months = CALCULATE(DISTINCTCOUNT(Purchases_All[Date].[Maand]),ALL(Purchases_All[Date].[Maand])
VAR count_quantity = CALCULATE(SUM(Purchases_All[Quantity]),ALL(Purchases_All[Date].[Maand])
RETURN DIVIDE(count_quantity, count_months)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 14 Sep 2023 10:15:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430676#M130059</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-14T10:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430796#M130073</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;BR /&gt;I've tested this function but the numbers are the same as the ones for quantity:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 11:10:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430796#M130073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-14T11:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430803#M130074</link>
      <description>&lt;P&gt;It isn't clear from your information if that date column is linked to a date dimension table. If it is, you would have to use the month column there in the ALL() function.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 11:13:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430803#M130074</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-14T11:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430840#M130077</link>
      <description>&lt;P&gt;There is no date dimension table involved. The data is loaded from a database and has only a date-column. When loading the data, automatically a date-hierarchy is included.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;In a first attempt I was working with a date-table. As a asking a colleague from help, he told me that he always works with the automatically added date-hierarchy, so thats why I tried to do it like that.&lt;BR /&gt;&lt;BR /&gt;I still have this 'old' version of my report, I will check if I get other/better results when using the formula there.&lt;BR /&gt;*Update* doesn't work, i get a 'syntax for Month is incorrect'-error ...&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Set-up from the 'old' file:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 11:28:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3430840#M130077</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-14T11:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3431021#M130087</link>
      <description>&lt;P&gt;These date hyrarchies make a bit more difficult than my initial suggestions, but I just tried something similar and the below should be better. Also not that it is referencing a hidden hierachy column there: "MaandNo"; this might have a different name but hopefully the intellisense will tell you.&lt;/P&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;&lt;LI-CODE lang="markup"&gt;avg quantity =
VAR count_months  = CALCULATE(COUNTX(VALUES(Purchases_All[Date].[Maand]),CALCULATE(COUNTROWS(Purchases_All))),ALL(Purchases_All[Date].[Maand]),ALL(Purchases_All[Date].[MaandNo]))
VAR count_quantity  = CALCULATE(SUM(Purchases_All[Quantity]),ALL(Purchases_All[Date].[Maand]),ALL(Purchases_All[Date].[MaandNo]))
RETURN IF(COUNTROWS(Purchases_All)&amp;gt;1,  DIVIDE(count_quantity, count_months))&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;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 13:53:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3431021#M130087</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-14T13:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433051#M130186</link>
      <description>&lt;P&gt;With the automatically included date-hierarchy, I don't have the MaandNo, so I tried to include it (column) and then use this in the formula but it doesn't work.&lt;BR /&gt;When I try the formula in the 'old' version (date-table added in a seperate table &amp;amp; linked), my result for average is equal to the sum of all purchases in the month ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe I should start again from the beginning. What is the easiest/best way to include a date-hierarchy? Automatically while loading the rapport (but this seems limited as I only have Year, Quarter, Month, Day) or by adding a independent date-table?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 13:46:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433051#M130186</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-15T13:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433066#M130191</link>
      <description>&lt;P&gt;like I mentioned earlier, it might not be named "MaandNo". Did you try the intellisense when editing the measure?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&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;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 14:02:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433066#M130191</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-15T14:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433079#M130192</link>
      <description>&lt;P&gt;A proper date dimension is always recommended as it gives you more options and more control. The measure will have to change significantly however.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 14:18:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433079#M130192</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-15T14:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433083#M130193</link>
      <description>&lt;P&gt;In the 'old' version with the date-table, I have the Month Number, so I changed the MaandNo to that but it isn't working.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 14:23:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433083#M130193</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-15T14:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433198#M130202</link>
      <description>&lt;P&gt;no, it works quite different with a date dimension. I have created a smilar model, so the column names are different, but this works:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;avg prm = 
VAR count_months  = CALCULATE(DISTINCTCOUNT('date'[nr_month])
        ,CALCULATETABLE(sales,ALL(),VALUES('date'[nr_year])) 
        ,CROSSFILTER('date'[dt_date],sales[dt_mutation],Both))
VAR count_quantity  = CALCULATE(SUM(sales[amt_ann_prm_net]),ALL('date'),VALUES('date'[nr_year]))
RETURN IF(COUNTROWS(sales)&amp;gt;1,  DIVIDE(count_quantity, count_months))
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 15 Sep 2023 15:53:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3433198#M130202</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-15T15:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3435663#M130355</link>
      <description>&lt;P&gt;Hi sjoerdvn,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you share your model, so I can compare with mine and see where it goes wrong? I used your formula, adjusted the column names to the 'right' ones but still doen't have what I need ..&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 08:46:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3435663#M130355</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-18T08:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3435879#M130366</link>
      <description>&lt;P&gt;Discovered a bug in my example, so changed my measure like below.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;avg prm = 
VAR count_months  = CALCULATE(DISTINCTCOUNT('date'[nr_month])
        ,CALCULATETABLE(sales,ALL(),VALUES('date'[nr_year])) 
        ,CROSSFILTER('date'[dt_date],sales[dt_mutation],Both))
VAR count_quantity  = CALCULATE(SUM(sales[amt_ann_prm_net]),ALL('date'),VALUES('date'[nr_year]))
RETURN IF(COUNTROWS(sales)&amp;gt;0,  DIVIDE(count_quantity, count_months))&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 10:29:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3435879#M130366</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-18T10:29:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3439516#M130585</link>
      <description>&lt;P&gt;It still doesn't work, although I'm following your instructions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Formula used:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;avg prm =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;count_months&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp;= &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DISTINCTCOUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Month Number]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt;)) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,&lt;/SPAN&gt;&lt;SPAN&gt;CROSSFILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Both&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;count_quantity&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp;= &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;[Quantity]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Year]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Purchases_All&lt;/SPAN&gt;&lt;SPAN&gt;)&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DIVIDE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;count_quantity&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;count_months&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;Relations between the tables:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Report:&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;I have the feeling that it has to do with something in my date-table, no?&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Sep 2023 07:55:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3439516#M130585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-20T07:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3439965#M130634</link>
      <description>&lt;P&gt;Hard to see without the data. Also I don't get the order in your month axis. it is neither sorted by month name, month number or any of the amounts?&lt;BR /&gt;Your "Month" column&amp;nbsp; should be sorted by your "Month number" column.&lt;BR /&gt;Also, for simplicity, maybe test first with just the total year amount.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;total year quantity = CALCULATE(SUM(Purchases_All[Quantity]),ALL('Date'),VALUES('Date'[Year]))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 20 Sep 2023 12:48:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3439965#M130634</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-20T12:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3439971#M130636</link>
      <description>&lt;P&gt;Did you add "avg prm" as a computed column instead of a measure?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 12:53:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3439971#M130636</guid>
      <dc:creator>sjoerdvn</dc:creator>
      <dc:date>2023-09-20T12:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating average on year</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3440016#M130641</link>
      <description>&lt;P&gt;Hallelujah, it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 13:19:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-average-on-year/m-p/3440016#M130641</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-20T13:19:35Z</dc:date>
    </item>
  </channel>
</rss>

