<?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: Weighted Moving Average in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2076440#M47043</link>
    <description>&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;Can anyone help me with this question?&lt;/SPAN&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Sep 2021 23:23:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-09-14T23:23:04Z</dc:date>
    <item>
      <title>Weighted Moving Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2049371#M46064</link>
      <description>&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Weighted Moving Average

Hello.

Personal, my doubt is how to calculate the weighted moving average, in Power Bi, the problem is when I have to calculate the cost of the unit sold, &lt;BR /&gt;multiplying by the average cost, and deducting this value from the Total.

Link with template file:&lt;/FONT&gt;&lt;A href="https://drive.google.com/drive/folders/1F4X244y3NXB-hnM8rOuqE1UMLVU_3msC?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/drive/folders/1F4X244y3NXB-hnM8rOuqE1UMLVU_3msC?usp=sharing&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Example:

Initial = 100 Units of Product X, at the cost of R$ 500.00 per batch

Acquisition of 200 Units of Product X, at the cost of R$ 1,150.00 per lot

The average cost of Product X will be:

BRL 500.00 + BRL 1,150.00 divided by (100 + 200) units

= BRL 1,650.00: 300

= BRL 5.50 per unit

In the effective sequence to a write-off of -120 units

= 120 multiplied at the cost of R$ 5.50 = -660

Accumulated cost goes from R$ 1650.00 - 660 = 990 and the Total of 300 units - 120 = 180, maintaining the average cost, until a new acquisition.


In the example below, where it is 7.19 the correct is 5.81, which would be R$ 1650.00 - 660.00 +1800 = 5.81, if there is no sale Works perfectly.&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="Y2IQFc"&gt;&amp;nbsp;&lt;/SPAN&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;SPAN class="Y2IQFc"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 00:28:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2049371#M46064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T00:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Moving Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2049582#M46070</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you please format the post in a convenient way to read it? Currently it requires people to scroll across and is not very readable. The font is weird as well. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Aug 2021 18:16:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2049582#M46070</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-08-31T18:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Moving Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2076440#M47043</link>
      <description>&lt;PRE&gt;&lt;SPAN class="Y2IQFc"&gt;Can anyone help me with this question?&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Sep 2021 23:23:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2076440#M47043</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T23:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Moving Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2076458#M47044</link>
      <description>&lt;P&gt;Your visual does not look like the one you've shown above:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 23:51:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2076458#M47044</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-09-14T23:51:00Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Moving Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2076496#M47050</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I adjusted, because I had improved the formula. Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 00:29:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2076496#M47050</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T00:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Moving Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2077172#M47071</link>
      <description>&lt;P&gt;I don't understand now... You've improved the formula, so it is already working fine?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 08:06:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2077172#M47071</guid>
      <dc:creator>daxer-almighty</dc:creator>
      <dc:date>2021-09-15T08:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted Moving Average</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2077489#M47085</link>
      <description>&lt;P&gt;&lt;SPAN&gt;No, it's still wrong, note in the image I updated, the correct result is from excel.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 10:23:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Weighted-Moving-Average/m-p/2077489#M47085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T10:23:05Z</dc:date>
    </item>
  </channel>
</rss>

