Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

how to calculate growth rate

Hi everyone, I have a table contains: Product, Month, Year, Sales revenue columns,

Capture.PNG

and I want to calculate the growth rate for product by month and by year. I have searched some topics and found that LOOKUPVALUE function is popular but I cannot write the formula to solve my problem. 

 

Can anyone help me with it? Thanks!

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Add a calculated column in data view mode (not measure, not in Query Editor mode) to original table:

Revenue LM =
LOOKUPVALUE (
    MonthGrowth[Month Revenue],
    MonthGrowth[Division], MonthGrowth[Division],
    MonthGrowth[Year], IF ( MonthGrowth[Month] = 1, MonthGrowth[Year] - 1, MonthGrowth[Year] ),
    MonthGrowth[Month], IF ( MonthGrowth[Month] = 1, 12, MonthGrowth[Month] - 1 )
)

1.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

14 REPLIES 14
Anonymous
Not applicable

Hello,

 

I need to calculate the fastest growth rate. I have a dataset which is as follows

2JZ_0-1644489904395.png

this contains population and GDP values for all states of USA from the year 1997 onwards.
I have calculated the GDP Growth and Population Growth Rates using measures, and now want to calculate the fastest growth rates among all states. Please can someone help.

Hi,

On a sample dataset (which can be pasted in an MS Excel file), please share the exact result that you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

YearAlabamaAlaskaArizonaArkansas
1997104087.425744.813241859865.6
1998109404.324170.4143392.462442.5
1999115030.924732.6155344.566816.7
2000119242.426778.3164611.668770
2001122449.328420.4171474.270601.4
2002127792.329605.3179413.373950.4
2003133739.231799.7192751.278218.8
2004146524.734970.7205420.884624.5
2005155970.439774.8228231.289610
2006163853.644435.3248230.794384.5
2007169678.448972.626232296948.2
2008172686.854752.4259366.798955.3
200916834849585.9243929.497058.9
201017475352882.5248210101690
2011181349.856259.9257947.8106085.4
201218629957670.1268288.8108745.2

 

This is a part of my dataset which has YoY GDP data for the 50 states of USA. Here I want to calculate the fastest GDP growth rate among these states. I have calculated the GDP growth rate in power BI by creating a measure, below is the code

 

GDP Growth =
var FirstYear = CALCULATE(MIN('Report Data'[Year]))
var LatestYear = CALCULATE(MAX('Report Data'[Year]))
var GDPFirstYear = CALCULATE('Report Data'[GDP Measure], 'Report Data'[Year] = FirstYear)
var GDPLatestYear = CALCULATE('Report Data'[GDP Measure], 'Report Data'[Year] = LatestYear)
var Diff = GDPLatestYear - GDPFirstYear
return DIVIDE(Diff, GDPFirstYear, 0)


 I want to calculate the max growth rate among these 50 states, i.e which states among these grew the fastest.

Hi,

Do you simply want to calculate the highest growth rate between first and last year or do you also want to know which was that state?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hello,

 

Yes, I want to know the state as well. Thank you.

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Add a calculated column in data view mode (not measure, not in Query Editor mode) to original table:

Revenue LM =
LOOKUPVALUE (
    MonthGrowth[Month Revenue],
    MonthGrowth[Division], MonthGrowth[Division],
    MonthGrowth[Year], IF ( MonthGrowth[Month] = 1, MonthGrowth[Year] - 1, MonthGrowth[Year] ),
    MonthGrowth[Month], IF ( MonthGrowth[Month] = 1, 12, MonthGrowth[Month] - 1 )
)

1.PNG

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

You might want to create a date column from your year and month columns and then you should be able to use the time intelligence functions such as PREVIOUSMONTH

 

https://msdn.microsoft.com/en-us/library/ee634758.aspx

 

and SAMEPERIODLASTYEAR

 

https://msdn.microsoft.com/en-us/library/ee634972.aspx

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi, thanks for your suggestions and I tried SAMPLEPERIODLASTYEAR. But the result is like

Capture.PNG

 

 

It has the total last year revenue but I may need the sales for every month. Can you help me with it?

Hi,

 

There's some work one will need here.  To use the Date/time intelligence functions, one must have:

 

  1. A date column in the base data; and
  2. A calendar table
  3. Two two tables should be related
  4. The time fields in your visuals should ideally be dragged from the calendar table

 

It is only then that the date/time intelligence functions will work.  Share your file to get more specific help.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi, thanks for your tips. Sorry that I am not very clear about it. Do you mean that I need create a calendar table and use the Date column in the calendar table as the axis in the visual? Because currently I only have one table like:

 

Capture.PNG

Yes, that is what i meant.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Mathur,

 

Your solution is great. However, I can't draw % grow vs last month on chart, as below. How can I fix it? Thank you in advance

image.pngimage.png

Hi,

Share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.