<?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: Median and Standard Deviation over a data set in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Median-and-Standard-Deviation-over-a-data-set/m-p/833855#M6090</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the below DAX function.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Standard Deviation Sales Qty = STDEV.P( Sales[Quantity] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Median Sales Qty = MEDIAN( Sales[Quantity] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are X functions available in both cases, so you can perform aggregations on different granularities if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/1232d707bb27fc4afa3b81cd0702c478b6f7aced/68747470733a2f2f7374617469632e6c6963646e2e636f6d2f736364732f636f6d6d6f6e2f752f696d616765732f6c6f676f732f6c696e6b6564696e2f6c6f676f5f6c696e6b6564696e5f39337832315f76322e706e67" border="0" alt="Mariusz Repczynski" /&gt;&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2019 11:44:19 GMT</pubDate>
    <dc:creator>Mariusz</dc:creator>
    <dc:date>2019-10-31T11:44:19Z</dc:date>
    <item>
      <title>Median and Standard Deviation over a data set</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Median-and-Standard-Deviation-over-a-data-set/m-p/833781#M6081</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’ve got the data set and a number of measures ...&lt;/P&gt;&lt;P&gt;&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;The first measure [Success_Count] calculates the number of Successes and the second [Average_Success] calculates the average Monthly success…&lt;/P&gt;&lt;P&gt;Success_Count = CALCULATE (&lt;BR /&gt;DISTINCTCOUNT(ExamResults[StudentID]),&lt;BR /&gt;FILTER (&lt;BR /&gt;ExamResults,&lt;BR /&gt;ExamResults[Months_on_Course] &amp;gt;= 3&lt;BR /&gt;&amp;amp;&amp;amp; ( ( ExamResults[ExamStatus] = "Pass" )&lt;BR /&gt;|| ( ExamResults[ExamStatus] = "Distinction" ) )&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Average_Success = DIVIDE([# Success_Count] ,DISTINCTCOUNT ( ExamResults[StartDate+3M]) )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My question is, how do I calculate the Median and Standard Deviation values by month across the data set. I've tried it various different ways using Calculated table&lt;BR /&gt;GroupBy etc,but can't seem to get it to work correctly, or get the "Student_Sum" below value into a Calculate function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DEFINE&lt;BR /&gt;VAR myGroup =&lt;BR /&gt;FILTER (&lt;BR /&gt;GROUPBY (&lt;BR /&gt;ExamResults,&lt;BR /&gt;ExamResults[Months_on_Course],&lt;BR /&gt;ExamResults[ExamStatus],&lt;BR /&gt;ExamResults[StartDate+3M],&lt;BR /&gt;"Student_Count", COUNTX ( CURRENTGROUP (), ExamResults[StudentID] )&lt;BR /&gt;),&lt;BR /&gt;ExamResults[Months_on_Course] &amp;gt;= 3&lt;BR /&gt;&amp;amp;&amp;amp; ( ( ExamResults[ExamStatus] = "Pass" )&lt;BR /&gt;|| ( ExamResults[ExamStatus] = "Distinction" ) )&lt;BR /&gt;)&lt;BR /&gt;EVALUATE&lt;BR /&gt;GROUPBY (&lt;BR /&gt;myGroup,&lt;BR /&gt;ExamResults[StartDate+3M],&lt;BR /&gt;"Student_Sum", SUMX ( CURRENTGROUP (), [Student_Count] )&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any suggestion much appreciated&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:15:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Median-and-Standard-Deviation-over-a-data-set/m-p/833781#M6081</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-31T10:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Median and Standard Deviation over a data set</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Median-and-Standard-Deviation-over-a-data-set/m-p/833855#M6090</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try the below DAX function.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Standard Deviation Sales Qty = STDEV.P( Sales[Quantity] )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Median Sales Qty = MEDIAN( Sales[Quantity] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are X functions available in both cases, so you can perform aggregations on different granularities if needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;Best Regards,&lt;BR /&gt;Mariusz&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;I&gt;Accepting it as the solution&lt;/I&gt;&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;Please feel free to connect with me.&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/mariusz-repczynski-065a7362/" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/1232d707bb27fc4afa3b81cd0702c478b6f7aced/68747470733a2f2f7374617469632e6c6963646e2e636f6d2f736364732f636f6d6d6f6e2f752f696d616765732f6c6f676f732f6c696e6b6564696e2f6c6f676f5f6c696e6b6564696e5f39337832315f76322e706e67" border="0" alt="Mariusz Repczynski" /&gt;&lt;/A&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 11:44:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Median-and-Standard-Deviation-over-a-data-set/m-p/833855#M6090</guid>
      <dc:creator>Mariusz</dc:creator>
      <dc:date>2019-10-31T11:44:19Z</dc:date>
    </item>
  </channel>
</rss>

