<?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: Find 95% Confidence Interval for Difference of Means in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3172813#M114443</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Confidence functions in DAX are used to help compute confidence intervals about the average value called the&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;sample mean. The value that gets returned is the margin of error (&lt;EM&gt;ME&lt;SPAN&gt;&amp;nbsp;) defined as:&lt;/SPAN&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class=""&gt;&lt;img /&gt;&lt;BR /&gt;
&lt;P&gt;For a 95% confidence interval, alpha is set to 0.05.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer to the following documents for more information.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/confidence-norm-function-dax" target="_blank" rel="noopener"&gt;CONFIDENCE.NORM function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.statology.org/confidence-interval-difference-between-means/" target="_blank" rel="noopener"&gt;Confidence Interval for the Difference Between Means - Statology&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dash-intel.com/powerbi/statistical_functions_confidence.php" target="_blank" rel="noopener"&gt;Confidence Functions in Power BI | Dash-Intel&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Finding-Confidence-Interval/m-p/1247207" target="_blank" rel="noopener"&gt;&amp;nbsp;Finding Confidence Interval - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps, &lt;/STRONG&gt;then please consider &lt;STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 05 Apr 2023 02:41:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-04-05T02:41:47Z</dc:date>
    <item>
      <title>Find 95% Confidence Interval for Difference of Means</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3170319#M114247</link>
      <description>&lt;P&gt;Client has asked for a graph of two columns' distributions to change color if the difference in means is ever statistically significant (or by my understanding, the 95% confidence interval doesn't contain 0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The changing color part is fairly idiomatic to Power BI. The 95% CI for Difference of Means? Not so much.&lt;BR /&gt;&lt;BR /&gt;I've got more math background than stats background. If nothing else, I can make one big fat DAX function using the mathematical formula for difference of means Confidence Interval, &lt;A title="hyperlink to a PNG of the formula" href="https://calcworkshop.com/wp-content/uploads/confidence-interval-formula-two-sample-mean-unknown-sigma.png" target="_self"&gt;which is a doozie&lt;/A&gt;. That feels like it's pretty computation-heavy, requiring two averages, two standard deviations, a T.INV, and a square root to be done just as the precursors to a final calculation. I'm wondering if there's a more efficient DAX approach to this than just brute-forcing the equation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looked into CONFIDENCE.T and CONFIDENCE.NORM, which are single-mean tests, and my gut tells me there might be a way to manipulate one of those into working, but I don't have the stats background to know what it would be.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 21:03:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3170319#M114247</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-03T21:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Find 95% Confidence Interval for Difference of Means</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3172813#M114443</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Confidence functions in DAX are used to help compute confidence intervals about the average value called the&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;sample mean. The value that gets returned is the margin of error (&lt;EM&gt;ME&lt;SPAN&gt;&amp;nbsp;) defined as:&lt;/SPAN&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class=""&gt;&lt;img /&gt;&lt;BR /&gt;
&lt;P&gt;For a 95% confidence interval, alpha is set to 0.05.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please refer to the following documents for more information.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/confidence-norm-function-dax" target="_blank" rel="noopener"&gt;CONFIDENCE.NORM function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.statology.org/confidence-interval-difference-between-means/" target="_blank" rel="noopener"&gt;Confidence Interval for the Difference Between Means - Statology&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dash-intel.com/powerbi/statistical_functions_confidence.php" target="_blank" rel="noopener"&gt;Confidence Functions in Power BI | Dash-Intel&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/Finding-Confidence-Interval/m-p/1247207" target="_blank" rel="noopener"&gt;&amp;nbsp;Finding Confidence Interval - Microsoft Power BI Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps, &lt;/STRONG&gt;then please consider &lt;STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 05 Apr 2023 02:41:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3172813#M114443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-05T02:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Find 95% Confidence Interval for Difference of Means</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3174664#M114557</link>
      <description>&lt;P&gt;I decided to make a brute force version, assigning variables so that I could copy/paste and edit this later down the line if I want to. For some reason it's now telling me that my syntax with DEFINE is incorrect? I'm not sure where the mistake is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Statistical Significance = 
DEFINE
    VAR mean1 = calculate(average('Data'[Column 1]), 'Data'[Column 2]="No")
    VAR mean2 = calculate(average('Data'[Column 1]), 'Data'[Column 2]="Yes")
    VAR count1 = calculate(count('Data'[Column 1]), 'Data'[Column 2]="No")
    VAR count2 = calculate(count('Data'[Column 1]), 'Data'[Column 2]="Yes")
    VAR stdv1 = calculate(STDEV.P('Data'[Column 1]), 'Data'[Column 2]="No")
    VAR stdv2 = calculate(STDEV.P('Data'[Column 1]), 'Data'[Column 2]="Yes")
    VAR alpha = 0.05
    VAR diffmean = ABS(mean1-mean2)
    VAR stderror = T.INV(alpha/2, count1+count2-2)*SQRT((stdv1*stdv1/count1)+(stdv2*stdv2/count2))
    VAR CI_min = min((diffmean-stderror), (diffmean+stderror))
    VAR CI_max = max((diffmean-stderror), (diffmean+stderror))
RETURN
    IF(CImin&amp;lt;0, if(0&amp;lt;CImax, False, True), True)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 05 Apr 2023 20:29:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3174664#M114557</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-05T20:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Find 95% Confidence Interval for Difference of Means</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3174888#M114574</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;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Statistical Significance = 
    VAR mean1 = calculate(average('Data'[Column 1]), 'Data'[Column 2]="No")
    VAR mean2 = calculate(average('Data'[Column 1]), 'Data'[Column 2]="Yes")
    VAR count1 = calculate(count('Data'[Column 1]), 'Data'[Column 2]="No")
    VAR count2 = calculate(count('Data'[Column 1]), 'Data'[Column 2]="Yes")
    VAR stdv1 = calculate(STDEV.P('Data'[Column 1]), 'Data'[Column 2]="No")
    VAR stdv2 = calculate(STDEV.P('Data'[Column 1]), 'Data'[Column 2]="Yes")
    VAR alpha = 0.05
    VAR diffmean = ABS(mean1-mean2)
    VAR stderror = T.INV(alpha/2, count1+count2-2)*SQRT((stdv1*stdv1/count1)+(stdv2*stdv2/count2))
    VAR CI_min = min((diffmean-stderror), (diffmean+stderror))
    VAR CI_max = max((diffmean-stderror), (diffmean+stderror))
RETURN
    IF(CImin&amp;lt;0, if(0&amp;lt;CImax, False, True), True)&lt;/LI-CODE&gt;
&lt;P&gt;For details on the use of DEFINE, please refer to&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/dax-queries#define-example" target="_blank"&gt;DAX Queries - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/define-statement-dax" target="_blank"&gt;DEFINE keyword (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 01:27:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-95-Confidence-Interval-for-Difference-of-Means/m-p/3174888#M114574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-06T01:27:49Z</dc:date>
    </item>
  </channel>
</rss>

