<?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: DAX - Average of a Distinct Count in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2024998#M45238</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="320419" data-lia-user-login="PeteDTG" class="lia-mention lia-mention-user"&gt;PeteDTG&lt;/a&gt; , Try a measure like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CALCULATE(averageX(values('edw dimDate'[month year]), calculate(DISTINCTCOUNT(PaycomHours[Employee_Code]))),DATESINPERIOD ('edw dimDate'[Date],MAX ( 'edw dimDate'[Date]),-12,MONTH))&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 05:49:14 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-08-19T05:49:14Z</dc:date>
    <item>
      <title>DAX - Average of a Distinct Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2024454#M45223</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking for some help with a DAX formula.&amp;nbsp; If you see the image below I am taking the distinct count of the employee_code field to obtain the number of employees per month.&amp;nbsp; However, I also need to show the last trailing 12 months as an average of the distinct counts.&amp;nbsp; How would I go about doing this in DAX?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get a distinct count for the last 12 months using the formula below, but it needs to be an average and not a count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Head Count LTM = CALCULATE(DISTINCTCOUNT(PaycomHours[Employee_Code]),DATESINPERIOD ('edw dimDate'[Date],MAX ( 'edw dimDate'[Date]),-12,MONTH))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 22:36:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2024454#M45223</guid>
      <dc:creator>PeteDTG</dc:creator>
      <dc:date>2021-08-18T22:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Average of a Distinct Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2024998#M45238</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="320419" data-lia-user-login="PeteDTG" class="lia-mention lia-mention-user"&gt;PeteDTG&lt;/a&gt; , Try a measure like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CALCULATE(averageX(values('edw dimDate'[month year]), calculate(DISTINCTCOUNT(PaycomHours[Employee_Code]))),DATESINPERIOD ('edw dimDate'[Date],MAX ( 'edw dimDate'[Date]),-12,MONTH))&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 05:49:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2024998#M45238</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-08-19T05:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Average of a Distinct Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2025142#M45240</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="320419" data-lia-user-login="PeteDTG" class="lia-mention lia-mention-user"&gt;PeteDTG&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please try using this :-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Avg of Head Count LTM = CALCULATE(AVERAGEX(PaycomHours,DISTINCTCOUNT(PaycomHours[Employee_Code])),DATESINPERIOD&lt;BR /&gt;('edw dimDate'[Date],MAX ( 'edw dimDate'[Date]),-12,MONTH))&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 06:43:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2025142#M45240</guid>
      <dc:creator>community_pinki</dc:creator>
      <dc:date>2021-08-19T06:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Average of a Distinct Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2026331#M45312</link>
      <description>&lt;P&gt;You are awesome, thank you so much! Didn't think to use AVERAGEX! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 14:23:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2026331#M45312</guid>
      <dc:creator>PeteDTG</dc:creator>
      <dc:date>2021-08-19T14:23:12Z</dc:date>
    </item>
    <item>
      <title>Re: DAX - Average of a Distinct Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2026332#M45313</link>
      <description>&lt;P&gt;Thank you so much!!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 14:23:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-Average-of-a-Distinct-Count/m-p/2026332#M45313</guid>
      <dc:creator>PeteDTG</dc:creator>
      <dc:date>2021-08-19T14:23:42Z</dc:date>
    </item>
  </channel>
</rss>

