Exponential Weighted Moving Average in power bi

Mayur 41 Reputation points
2021-12-16T04:11:41.983+00:00

Hello, I am new to DAX and trying to calculate Exponential Weighted Moving Average for one of my report.
Please find below data element and expected result which I have calculated manually into excel and would like to replicate same logic to DAX so I can utilize into my Power BI report.
For very first month from selection it should use mean value for calculation as shown in below table and for all upcoming months calculated result value from previous month would be used instead of mean.

158246-sampledata.txt

157998-image.png

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,344 questions
Community Center | Not monitored
{count} votes

3 answers

Sort by: Most helpful
  1. CarrinWu-MSFT 6,891 Reputation points
    2021-12-16T06:54:20.727+00:00

    Hi @Mayur ,

    Thanks for your posting.

    We are willing to help you, but your question is related to Power BI, please post your question in Microsoft Power BI Community that can let you get more helps. And I suggest that please provide more details about your question.

    Best regards,
    Carrin


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Miraç Öztürk 81 Reputation points
    2022-06-26T18:57:12.57+00:00

    You can easily solve this with Column From Example. (Without calculating)
    This solution is the same as Power BI;

    For Excel;
    https://support.microsoft.com/en-us/office/add-a-column-from-an-example-power-query-cd82c570-8da7-4d70-91a1-3827b5995eab

    For Power BI;
    https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-add-column-from-example

    0 comments No comments

  3. Blake Beckemeyer 1 Reputation point
    2022-12-17T21:39:08.783+00:00

    Any aggregations in Power BI should be done using either variables or measures. The nomenclature for variables is VAR and then define your variable. The function will produce whatever follows the RETURN verb.

    For this situation I suggest measures instead that are referenced by a variable, just in case you want to represent those on their own.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.