cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## Average Growth Rate

How to calculate Average growth rate over time Dax query

Let say
Number of milk cans sold by the company in the past four years:

2018 = 350
2019 = 450
2020 = 500
2021 = 650

Calculate the company's average annual growth rate.

So, if the present value is 650, the past value is 350 and the number of years is 4, you get:

Growth rate after 2018: (450 - 350) / 350 x 100 = 28.57%

Growth rate after 2019: (500 - 450) / 450 x 100 = 11.11%

Growth rate after 2020: (650 - 500) / 500 x 100 = 30%

Average growth rate over time = (28.57% + 11.11% + 30%) / 3 = 23.22% per year

Im struggling to get this in dax query .
Please Suggest a method to get Average growth rate over time

1 ACCEPTED SOLUTION
Super User

Hi,

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
12 REPLIES 12
Super User

@vivek_rana , using a separate date or year table

//Only year vs Year, not a level below

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))

diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

Now create Avg diff %

Avg diff % = AverageX(values('Date'[Year]), [diff %])

Frequent Visitor

How can we do it at Year -month level. I tried replacing Year with Yearmonth field from calender table..but seems like its not working... Can you please suggest here.

Super User

What result are you expecting?  Please show that clearly.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Frequent Visitor

@Ashish_Mathur   .- I have this Output right now, with month over month percentage difference calculated.

 Date(Month/Year) Amount MOM Percentage Difference May 2022 7468 -80% April 2022 36522 -38% March 2022 58872 190% Feb 2022 20301 -54% Jan 2022 43971 -55% Dec 2021 96699

I am trying to show Average of  MOM Percentage Difference in a CARD.

so I think output should be    (-80+(-38)+190+(-54)+(-55))/5     = -7.40.

Please correct me if i am wrong.

Sharing Calculation for MOM Percentage Difference :

MoM% =
VAR Sum_CY = SUM ( Orders[Sales] )
VAR Sum_PY =
CALCULATE (
SUM ( Orders[Sales] ),
ALLEXCEPT (Orders,Orders[Category]),
DATEADD ( 'Calendar'[Date].[Date], -1, MONTH )
)
VAR MoM =
DIVIDE ( Sum_CY, Sum_PY ) - 1
Var Result =
IF (
MoM = -1,
BLANK (),
MoM
)
Return Result

Super User

Hi,

Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Regular Visitor

Hi, I have a request to calculate the average growth rate for the last 5 years, the last 7 years, and so on. I have calculated the average growth for all years but am struggling to do this new request in the Dax query.

Super User

Hi,

Share some data, explain the question and show the expected result.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Regular Visitor

Thank you for your quick response. I have a data set that has data from 1995 to 2022, and I have calculated the average growth rate from 1995 to 2022. I now need to calculate the average growth rate for the last 5 years, the last 7 years, etc. See the below example.

 FY Description Value Growth Rate 2010 Sales \$                                       85,063.54 2011 Sales \$                                       86,500.00 1.7% 2012 Sales \$                                       83,200.00 -3.8% 2013 Sales \$                                       88,250.00 6.1% 2014 Sales \$                                       89,425.00 1.3% 2015 Sales \$                                       90,120.00 0.8% 2016 Sales \$                                       91,250.00 1.3% 2017 Sales \$                                       95,500.00 4.7% 2018 Sales \$                                       96,100.00 0.6% 2019 Sales \$                                       97,280.00 1.2% 2020 Sales \$                                       95,250.00 -2.1% 2021 Sales \$                                    100,150.00 5.1% 2022 Sales \$                                    120,250.00 20.1% Average Growth Rate from 2010 to 2022 3.08% Average Growth Rate from 2018 to 2022 (Last 5 Years) 5.0% Average Growth Rate from 2016 to 2022 (Last 7 Years) 4.4%

I have calculated the average growth from 2010 to 2022, which is 3.08%, but I'm having trouble figuring out the 5.0% growth rate during the previous five years. I created a DAX formula, but it did calculate the average of 5 years for all years, but still, it was wrong. Any help would be appreciated.

Frequent Visitor

Thank you Ashish . That worked.

Super User

You are welcome.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Frequent Visitor

Hello I am having the same problem as well. Can you upload the file again so that I can check the dax? Thank you

Super User

Hi,

File attachd.

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.