<?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: How to calculate average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2857549#M91904</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="379498" data-lia-user-login="Steph83" class="lia-mention lia-mention-user"&gt;Steph83&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do you mean you have a column in your rmtable that specifies the date when the record was added? And you want the date slicer selected date to filter all thoses records which were added on or before the selected date?&lt;/P&gt;
&lt;P&gt;on the other hand I believe the provided measure shall not have any issue with your page and report filters. It should work with these filters just fine.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Oct 2022 15:27:22 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-10-23T15:27:22Z</dc:date>
    <item>
      <title>How to calculate average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2857494#M91900</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I closed my topic too quickly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here was my demand:&lt;/P&gt;&lt;P&gt;How to calculate average age of a group of persons in XX years?&lt;BR /&gt;I have a group of 300 people ("Artists") for whom I have their date of birth ("date of birth").&lt;/P&gt;&lt;P&gt;I would like to know the average age of this group on a specific date that I would select in a dashboard filter.&lt;/P&gt;&lt;P&gt;In fact my data base gathered all persons, but all are not available all the time. So I need to know, among the persons who are there, at a specific date, the average age of the persons&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John proposed the following:&lt;/P&gt;&lt;P&gt;Average age =&lt;BR /&gt;VAR ReferenceDate =&lt;BR /&gt;SELECTEDVALUE ( 'Slicer date'[Date] )&lt;BR /&gt;VAR Result =&lt;BR /&gt;AVERAGEX ( Artists, DATEDIFF ( Artists[Date of birth], ReferenceDate, YEAR ) )&lt;BR /&gt;RETURN&lt;BR /&gt;Result&lt;BR /&gt;where 'Slicer date'[Date] is the column you are using on the slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something is missing. I have well the average of the list of persons at a selected date, however, it gives the average of all the persons whatever the filter applied on the page (gender, above 30....). How can I include the selected filters in the formula so as to calculate the average on the selected persons only?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for you support&lt;/P&gt;&lt;P&gt;Stephane&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 23 Oct 2022 14:27:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2857494#M91900</guid>
      <dc:creator>Steph83</dc:creator>
      <dc:date>2022-10-23T14:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2857549#M91904</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="379498" data-lia-user-login="Steph83" class="lia-mention lia-mention-user"&gt;Steph83&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do you mean you have a column in your rmtable that specifies the date when the record was added? And you want the date slicer selected date to filter all thoses records which were added on or before the selected date?&lt;/P&gt;
&lt;P&gt;on the other hand I believe the provided measure shall not have any issue with your page and report filters. It should work with these filters just fine.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 15:27:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2857549#M91904</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-23T15:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2857612#M91910</link>
      <description>&lt;P&gt;Hi&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;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 tables:&lt;/P&gt;&lt;P&gt;1 - One table which lists the people month by month&lt;/P&gt;&lt;P&gt;2 - One table which contains all the data of the persons&lt;/P&gt;&lt;P&gt;Both table are linked by the person (1 to multiple)&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 17:31:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2857612#M91910</guid>
      <dc:creator>Steph83</dc:creator>
      <dc:date>2022-10-23T17:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2858767#M91973</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="379498" data-lia-user-login="Steph83" class="lia-mention lia-mention-user"&gt;Steph83&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I hope the month column is Date formatted (I called [Date Added] in my code)&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;Average age =
VAR ReferenceDate =
    SELECTEDVALUE ( 'Slicer date'[Date] )
VAR Result =
    AVERAGEX (
        CALCULATETABLE (
            Artists,
            People[Date Added] &amp;lt;= ReferenceDate,
            CROSSFILTER ( Artists[Person ID], People[Person ID], BOTH )
        ),
        DATEDIFF ( Artists[Date of birth], ReferenceDate, YEAR )
    )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Oct 2022 09:43:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2858767#M91973</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-24T09:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2859132#M92015</link>
      <description>&lt;P&gt;Hi&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;,&lt;/P&gt;&lt;P&gt;It works perfectly, thanks for your support!&lt;/P&gt;&lt;P&gt;Stephane&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 12:28:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-average/m-p/2859132#M92015</guid>
      <dc:creator>Steph83</dc:creator>
      <dc:date>2022-10-24T12:28:46Z</dc:date>
    </item>
  </channel>
</rss>

