cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

How to create CAGR % in Row wise

Hi,

 

I have data like 

CountryDateYearQuarterSalesCAGR%

 

I need to get last 5 years CAGR value in ROW wise in a Table view

 

There is filters selection required

 

My below calculation is not giving me Row level CAGR value

CAGR = (Ending year value/ Starting year value)^(1/no.of years) -1

 

This is my formula for this

Ending year value = CALCULATE(SUM('Yearly Data'[Oil Production(MMBPD)]),FILTER('Yearly Data','Yearly Data'[Year]=Max('Yearly Data'[Year])))

 

Starting year value= CALCULATE(SUM('Yearly Data'[Oil Production(MMBPD)]),FILTER('Yearly Data','Yearly Data'[Year]=MIN('Yearly Data'[Year])))
 
No of years = MAX('Yearly Data'[Year])-MIN('Yearly Data'[Year])
 
Thanks in advance! Please help
5 REPLIES 5
Highlighted
Super User I
Super User I

Re: How to create CAGR % in Row wise

can you share some data in text format, or what are you getting and what should you be getting, provide some examples.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Helper V
Helper V

Re: How to create CAGR % in Row wise

Above provide one is my table structure.

Highlighted
Super User IV
Super User IV

Re: How to create CAGR % in Row wise

@BhavyaM ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper V
Helper V

Re: How to create CAGR % in Row wise

Hi,

 

Below one is my expected result.

Expected result.JPG

When i apply initial provided Calculation i am getting result like below

 

My query result.JPG

 

Thanks in advance

Highlighted
Microsoft
Microsoft

Re: How to create CAGR % in Row wise

Hi @BhavyaM ,

 

Lack of your sample data , so I can only find the part of your formula that may be the cause of the problem:

 

 

Ending year value = VAR MAXDATE = CALCULATE(Max('Yearly Data'[Year]),ALL('Yearly Data'))RETURN (CALCULATE(SUM('Yearly Data'[Oil Production(MMBPD)]),FILTER('Yearly Data','Yearly Data'[Year]=MAXDATE))

 

Starting year value= VAR MINDATE = CALCULATE(Max('Yearly Data'[Year]),ALL('Yearly Data'))RETURN CALCULATE(SUM('Yearly Data'[Oil Production(MMBPD)]),FILTER('Yearly Data','Yearly Data'[Year]=MINDATE))

 

 

In your original formula, if the max and min functions are in the same context, they will get the same result.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors