Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculate growth dynamically

Hello everyone !

I have a fact table connected to dimension tables (Time, Market and Period)

For each product, i would like to calculate the growth per period [L3Months, L6M, MAT]

My data for a specific product is presented as follows and the only selector i can have in the report is a location selector.  As for the date, I compare to the last available month

 

 

 

 

 

 

 

 

 

 

 

 

I have created the following dax measure to calculate the growth for 3M. However, this formula isn’t dynamic, (i can’t change the dateadd interval to go back 6months for L6M or 12 months for MAT) so I needed to create a measure for each case

 

 

 

 

 

 

And at the end I have the following table

I don’t know what to do to have be able to display a table as follow, I tried to use switch , if cases and didn't manage to get any results. 

 

Thank you so much for your help in advance, 

Mari,

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello Anonymous 

     

    For my data I actaully have the the data aggregate for different periods (3m, 6m,..)

    So what I did I addeded a filter to the specific period that I want and managed to get the growth for that specific period. 

     

    So now I have the correct results

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    You can refer the following blogs to achieve it. If it's not applicable for your scenario, please provide some sample data in dimension table and fact table and relationships among them. Thank you.

    Calculate Percentage Growth Over Time with Power BI

    Calculate and Analyzing Growth Rates With DAX Language

    Best Regards
    Community Support Team _ Rena Ruan
    If this post helps, then please consider Accept it as the solution to help the other members find it more.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello Anonymous 

     

    Thank you for your reply, I actaully managed to change the forumla and get a result on my own. Juste needed to filter correctly my data 

     

    Thank you again for your help, 

    Mariem

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,

      Do you mean that it can't get the correct result when apply any filter? Could you please provide your filtered fields with screenshots? It is better if you can provide your sample pbix file in order to make troubleshooting and get solution. Thank you in advance.

      Best Regards
      Community Support Team _ Rena Ruan
      If this post helps, then please consider Accept it as the solution to help the other members find it more.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hello Anonymous 

         

        For my data I actaully have the the data aggregate for different periods (3m, 6m,..)

        So what I did I addeded a filter to the specific period that I want and managed to get the growth for that specific period. 

         

        So now I have the correct results