<?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 Correct Total of Product using Linear Regression % in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2729924#M83563</link>
    <description>&lt;P&gt;I have a measure that calculates the Linear Fcst %.&amp;nbsp; &amp;nbsp;The measure works perfect and I get the correct results by month.&amp;nbsp; I need to take forecast values and multiply against the linear regression %.&amp;nbsp; Simply taking Fcst * Regress % works perfectly fine within a given month, but the total column does not work.&amp;nbsp; I've tried SUMX( values(Date[month]), Fcst*Regress), but the Linear Regression % reverts to looking at only the selected month.&amp;nbsp; I basically lose my forecasted values because the Linear Regression % gets iterated over an individual month.&amp;nbsp; I hope that makes sense.&amp;nbsp; Any help is greatly appreciated...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below pic...&amp;nbsp; Booked Sales Linear is correct by month...but the 560,638 is incorrect.&lt;/P&gt;&lt;P&gt;Total Booked Sales Linear has the correct total...but the by month is incorrect.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the blog post providing the fcst logic.&lt;/P&gt;&lt;P&gt;&lt;A href="https://xxlbi.com/blog/simple-linear-regression-in-dax/" target="_blank"&gt;https://xxlbi.com/blog/simple-linear-regression-in-dax/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2022 23:10:57 GMT</pubDate>
    <dc:creator>codyraptor</dc:creator>
    <dc:date>2022-08-26T23:10:57Z</dc:date>
    <item>
      <title>Correct Total of Product using Linear Regression %</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2729924#M83563</link>
      <description>&lt;P&gt;I have a measure that calculates the Linear Fcst %.&amp;nbsp; &amp;nbsp;The measure works perfect and I get the correct results by month.&amp;nbsp; I need to take forecast values and multiply against the linear regression %.&amp;nbsp; Simply taking Fcst * Regress % works perfectly fine within a given month, but the total column does not work.&amp;nbsp; I've tried SUMX( values(Date[month]), Fcst*Regress), but the Linear Regression % reverts to looking at only the selected month.&amp;nbsp; I basically lose my forecasted values because the Linear Regression % gets iterated over an individual month.&amp;nbsp; I hope that makes sense.&amp;nbsp; Any help is greatly appreciated...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the below pic...&amp;nbsp; Booked Sales Linear is correct by month...but the 560,638 is incorrect.&lt;/P&gt;&lt;P&gt;Total Booked Sales Linear has the correct total...but the by month is incorrect.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the blog post providing the fcst logic.&lt;/P&gt;&lt;P&gt;&lt;A href="https://xxlbi.com/blog/simple-linear-regression-in-dax/" target="_blank"&gt;https://xxlbi.com/blog/simple-linear-regression-in-dax/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 23:10:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2729924#M83563</guid>
      <dc:creator>codyraptor</dc:creator>
      <dc:date>2022-08-26T23:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Total of Product using Linear Regression %</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2730705#M83613</link>
      <description>&lt;P&gt;To calculate the correct regression values in the individual cells you have to use &lt;STRONG&gt;ALLSELECTED&lt;/STRONG&gt;&amp;nbsp;in its body because &lt;STRONG&gt;ALLSELECTED&lt;/STRONG&gt;&amp;nbsp;lets you look at all the selected something you have put on the colums, not only on the individual value in the column.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 07:35:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2730705#M83613</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-08-28T07:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Total of Product using Linear Regression %</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2730857#M83633</link>
      <description>&lt;P&gt;Yep...I'm using allselected in the measure to caluclate the correct regression.&amp;nbsp; It's just when I go to use 'sumx(months, fcst*regression %)'...it seems to remove the 'all selected' within the regression measure.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 14:36:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2730857#M83633</guid>
      <dc:creator>codyraptor</dc:creator>
      <dc:date>2022-08-28T14:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Total of Product using Linear Regression %</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2730897#M83636</link>
      <description>&lt;P&gt;That's most likely because you should never use any measure with ALLSELECTED in it in an iterator. There are many reasons for this limitation and you can find articles about this on &lt;A href="http://www.sqlbi.com" target="_blank" rel="noopener"&gt;www.sqlbi.com&lt;/A&gt;. Check this one out:&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/the-definitive-guide-to-allselected/" target="_blank" rel="noopener"&gt;The definitive guide to ALLSELECTED - SQLBI&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the time being I don't have time to look at this in full depth but I'll try to find some time later on. But you should definitely read the article above. ALLSELECTED measures should always be only top-level measures. Sadly, this is not the case in your code and this very likely is the problem.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 15:54:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Correct-Total-of-Product-using-Linear-Regression/m-p/2730897#M83636</guid>
      <dc:creator>daXtreme</dc:creator>
      <dc:date>2022-08-28T15:54:11Z</dc:date>
    </item>
  </channel>
</rss>

