<?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 Ignore measure subgroups when charting and in calculations? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ignore-measure-subgroups-when-charting-and-in-calculations/m-p/812811#M5279</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to use Power Bi to make dynamic X and Rbar control charts that are used in quality control, statistical process control.&amp;nbsp; I don't want to get to jargon-y, so I will try to explain the specific calculations I need to make without getting to far into control charts.&amp;nbsp; But if you want more info, you can look here&amp;nbsp;&amp;nbsp;&lt;A href="https://www.spcforexcel.com/knowledge/variable-control-charts/xbar-r-charts-part-1" target="_blank" rel="noopener"&gt;https://www.spcforexcel.com/knowledge/variable-control-charts/xbar-r-charts-part-1&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of my data structure.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Batch&lt;/TD&gt;&lt;TD&gt;Sample&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;TD&gt;200.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;300.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;A3&lt;/TD&gt;&lt;TD&gt;134.7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;B1&lt;/TD&gt;&lt;TD&gt;200.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;B2&lt;/TD&gt;&lt;TD&gt;300.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;250.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;50.7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C3&lt;/TD&gt;&lt;TD&gt;692.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C4&lt;/TD&gt;&lt;TD&gt;237.9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where Batch is a unique product batch, Sample is a sample of a manufactured item within that batch, and Value is some quantifiable measure (weight, length, concentration, etc).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make my xbar and R chart, I need to be able to calculate and plot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;xbar- this is the overall average of the batch averages.&amp;nbsp; So if I took the average value of batch A, B and c separately, then averaged those 3 values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rbar- this is the overall average of the batch value rage.&amp;nbsp; So if I took the range value of batch A, B and C separately, then averaged those 3 values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to use code like that below to calculate xbar as a measure.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;xbar:=averagex(summarize(Table,[Batch],"Example",average([Value])),[Example])&lt;/PRE&gt;&lt;P&gt;However, if I try to plot this value with Batch vs. Value on the x and y axes, the value of xbar will be evaluated at the specified level of batch.&amp;nbsp; Instead, I need the value of xbar that is the average of all batch averages -- which will be the same for all batches.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/570f41231086c2d381a6ec632e7eb95e50a0a931/68747470733a2f2f6962622e636f2f63774c4a7a4c6e" border="0" alt="https://ibb.co/cwLJzLn" width="480" height="88" /&gt;&lt;/P&gt;&lt;P&gt;Is there a way to use the measure in the way described or do I need to take a different approach??&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2019 16:38:35 GMT</pubDate>
    <dc:creator>mrlang02</dc:creator>
    <dc:date>2019-10-23T16:38:35Z</dc:date>
    <item>
      <title>Ignore measure subgroups when charting and in calculations?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ignore-measure-subgroups-when-charting-and-in-calculations/m-p/812811#M5279</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to use Power Bi to make dynamic X and Rbar control charts that are used in quality control, statistical process control.&amp;nbsp; I don't want to get to jargon-y, so I will try to explain the specific calculations I need to make without getting to far into control charts.&amp;nbsp; But if you want more info, you can look here&amp;nbsp;&amp;nbsp;&lt;A href="https://www.spcforexcel.com/knowledge/variable-control-charts/xbar-r-charts-part-1" target="_blank" rel="noopener"&gt;https://www.spcforexcel.com/knowledge/variable-control-charts/xbar-r-char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C&lt;/TD&gt;&lt;TD&gt;C4&lt;/TD&gt;&lt;TD&gt;237.9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where Batch is a unique product batch, Sample is a sample of a manufactured item within that batch, and Value is some quantifiable measure (weight, length, concentration, etc).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make my xbar and R chart, I need to be able to calculate and plot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;xbar- this is the overall average of the batch averages.&amp;nbsp; So if I took the average value of batch A, B and c separately, then averaged those 3 values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;rbar- this is the overall average of the batch value rage.&amp;nbsp; So if I took the range value of batch A, B and C separately, then averaged those 3 values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to use code like that below to calculate xbar as a measure.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;xbar:=averagex(summarize(Table,[Batch],"Example",average([Value])),[Example])&lt;/PRE&gt;&lt;P&gt;However, if I try to plot this value with Batch vs. Value on the x and y axes, the value of xbar will be evaluated at the specified level of batch.&amp;nbsp; Instead, I need the value of xbar that is the average of all batch averages -- which will be the same for all batches.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://ip1.i.lithium.com/570f41231086c2d381a6ec632e7eb95e50a0a931/68747470733a2f2f6962622e636f2f63774c4a7a4c6e" border="0" alt="https://ibb.co/cwLJzLn" width="480" height="88" /&gt;&lt;/P&gt;&lt;P&gt;Is there a way to use the measure in the way described or do I need to take a different approach??&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 16:38:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ignore-measure-subgroups-when-charting-and-in-calculations/m-p/812811#M5279</guid>
      <dc:creator>mrlang02</dc:creator>
      <dc:date>2019-10-23T16:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore measure subgroups when charting and in calculations?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ignore-measure-subgroups-when-charting-and-in-calculations/m-p/812859#M5280</link>
      <description>&lt;P&gt;you can use ALL() in dax to remove any filter context from a table&lt;/P&gt;&lt;PRE&gt;xbar:=averagex(summarize(Table,[Batch],"Example",average([Value])),[Example])&lt;/PRE&gt;&lt;P&gt;using ALL(Table) might work for you&lt;/P&gt;&lt;P&gt;but SUMMARIZE is a lot more complicated than it looks&lt;/P&gt;&lt;P&gt;if you want to go into it and understand just what is going on take a look at&amp;nbsp; &lt;A href="https://www.sqlbi.com/articles/all-the-secrets-of-summarize/" target="_blank"&gt;https://www.sqlbi.com/articles/all-the-secrets-of-summarize/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 20:52:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ignore-measure-subgroups-when-charting-and-in-calculations/m-p/812859#M5280</guid>
      <dc:creator>kentyler</dc:creator>
      <dc:date>2019-10-08T20:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Ignore measure subgroups when charting and in calculations?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ignore-measure-subgroups-when-charting-and-in-calculations/m-p/826511#M5815</link>
      <description>&lt;PRE&gt;xbar:=CALCULATE ( SUM ( [Value ), ALLSELECTED( Table ) )
    / CALCULATE ( COUNT (Table[Batch]), ALLSELECTED( Table) )&lt;/PRE&gt;&lt;P&gt;For those interested, this was the solution to my problem.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 16:28:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Ignore-measure-subgroups-when-charting-and-in-calculations/m-p/826511#M5815</guid>
      <dc:creator>mrlang02</dc:creator>
      <dc:date>2019-10-23T16:28:42Z</dc:date>
    </item>
  </channel>
</rss>

