<?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 Nelson Rule Implementation in Power BI in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4307071#M171029</link>
    <description>&lt;P&gt;I have to create a control chart which includes Mean , Std dev &amp;amp; control limits as well along with that we need to implement Nelson Rules in it which shows different violated points in diff colors.&lt;BR /&gt;if we talk about that chart we would like to see Batch IDs on the x axis and sum of Numer_Values on the Y axis. Batch IDs are string type and contains 'A01234' or 'BSD123' or '123456' this type of entries. plotting of points would be on Batch Mfg Dates which are not continous, we can see differences in between points.&lt;BR /&gt;First visual would be sorted on mfg date and if dates are same then on batch numbers.&lt;BR /&gt;Can somebody please help me with the DAX code for all the rules by creating and implementing the Nelson Rules.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to this type of visual so please thanks in advance.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Nov 2024 06:43:33 GMT</pubDate>
    <dc:creator>sh_Himanshu</dc:creator>
    <dc:date>2024-11-29T06:43:33Z</dc:date>
    <item>
      <title>Nelson Rule Implementation in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4307071#M171029</link>
      <description>&lt;P&gt;I have to create a control chart which includes Mean , Std dev &amp;amp; control limits as well along with that we need to implement Nelson Rules in it which shows different violated points in diff colors.&lt;BR /&gt;if we talk about that chart we would like to see Batch IDs on the x axis and sum of Numer_Values on the Y axis. Batch IDs are string type and contains 'A01234' or 'BSD123' or '123456' this type of entries. plotting of points would be on Batch Mfg Dates which are not continous, we can see differences in between points.&lt;BR /&gt;First visual would be sorted on mfg date and if dates are same then on batch numbers.&lt;BR /&gt;Can somebody please help me with the DAX code for all the rules by creating and implementing the Nelson Rules.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to this type of visual so please thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 06:43:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4307071#M171029</guid>
      <dc:creator>sh_Himanshu</dc:creator>
      <dc:date>2024-11-29T06:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Nelson Rule Implementation in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4307093#M171030</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="873887" data-lia-user-login="sh_Himanshu" class="lia-mention lia-mention-user"&gt;sh_Himanshu&lt;/a&gt;&amp;nbsp;, Try using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mean_Numer_Values = AVERAGE('Table'[Numer_Values])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;StdDev_Numer_Values = STDEV.P('Table'[Numer_Values])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UCL = [Mean_Numer_Values] + 3 * [StdDev_Numer_Values]&lt;BR /&gt;LCL = [Mean_Numer_Values] - 3 * [StdDev_Numer_Values]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One point more than 3 standard deviations from the mean):&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Nelson_Rule1 = &lt;BR /&gt;IF(&lt;BR /&gt;ABS('Table'[Numer_Values] - [Mean_Numer_Values]) &amp;gt; 3 * [StdDev_Numer_Values],&lt;BR /&gt;1,&lt;BR /&gt;0&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nelson Rule 2 (Nine (or more) points in a row on the same side of the mean):&lt;/P&gt;
&lt;P&gt;DAX&lt;BR /&gt;Nelson_Rule2 = &lt;BR /&gt;VAR CurrentIndex = RANKX(ALL('Table'), 'Table'[Mfg_Date], , ASC, DENSE)&lt;BR /&gt;VAR PreviousValues = &lt;BR /&gt;CALCULATETABLE(&lt;BR /&gt;TOPN(8, &lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Table'), &lt;BR /&gt;RANKX(ALL('Table'), 'Table'[Mfg_Date], , ASC, DENSE) &amp;lt; CurrentIndex&lt;BR /&gt;), &lt;BR /&gt;'Table'[Mfg_Date], &lt;BR /&gt;ASC&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;VAR SameSideCount = &lt;BR /&gt;COUNTROWS(&lt;BR /&gt;FILTER(&lt;BR /&gt;PreviousValues, &lt;BR /&gt;SIGN('Table'[Numer_Values] - [Mean_Numer_Values]) = SIGN(EARLIER('Table'[Numer_Values] - [Mean_Numer_Values]))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;RETURN&lt;BR /&gt;IF(SameSideCount &amp;gt;= 8, 1, 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a scatter plot visual to your report.&lt;BR /&gt;Set the X-axis to Batch IDs and the Y-axis to the sum of Numer_Values.&lt;BR /&gt;Add the measures for Mean, UCL, and LCL as reference lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use conditional formatting to color code the points based on the Nelson Rules measures.&lt;BR /&gt;For example, if Nelson_Rule1 is violated, color the point red.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:00:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4307093#M171030</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2024-11-29T07:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Nelson Rule Implementation in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4307193#M171033</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;Thanks for guiding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here couple of doubt for rule2 , If mfg dates are same for more than 1 rows then ranking is going to be same so to how to overcome that and also getting some error. with&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SameSideCount&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Attached is the screenshot, please help me here&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;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:37:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4307193#M171033</guid>
      <dc:creator>sh_Himanshu</dc:creator>
      <dc:date>2024-11-29T07:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Nelson Rule Implementation in Power BI</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4309435#M171135</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="873887" data-lia-user-login="sh_Himanshu" class="lia-mention lia-mention-user"&gt;sh_Himanshu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on the description, try to add a secondary ranking based on Batch ID to make sure unique ranking. Use the following DAX formula.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Nelson_Rule2 = 
VAR CurrentIndex = RANKX(ALL('Table'), 'Table'[Mfg_Date] &amp;amp; 'Table'[Batch_ID], , ASC, DENSE)
VAR PreviousValues = CALCULATETABLE(
    TOPN(8, FILTER(ALL('Table'), RANKX(ALL('Table'), 'Table'[Mfg_Date] &amp;amp; 'Table'[Batch_ID], , ASC, DENSE) &amp;lt; CurrentIndex), 'Table'[Mfg_Date], ASC)
)
VAR SameSideCount = COUNTROWS(
    FILTER(PreviousValues, SIGN('Table'[Numer_Values] - [Mean_Numer_Values]) = SIGN(EARLIER('Table'[Numer_Values] - [Mean_Numer_Values])))
)
RETURN IF(SameSideCount &amp;gt;= 8, 1, 0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 07:36:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nelson-Rule-Implementation-in-Power-BI/m-p/4309435#M171135</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-02T07:36:33Z</dc:date>
    </item>
  </channel>
</rss>

