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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
THENNA_41
Post Partisan
Post Partisan

Compound Growth Rate for Month wise

I have the few years Data from 2021 to 2025 .  Every year have QTY month wise . i  want find  compund growth for month wise . i used below formula for Years in Excel . i want to convert to Month.

 

Syntax:

((currentyear)/(previousyear))^(1-n))-1

 

LIke : 

((Currentmonth)/(PreviousMonth))^(1-n))-1

 

QTY   Month   year

10       Jan       2021

20       Feb      2021

30       Mar      2021

40       Apr       2021

 

-----

 

---

21        Dec      2025

 

Looking for support .. thanks in advance 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @THENNA_41 

supposing you have a table like:

YearMonthQty
202291
2022102
2022113
2022124
202315
202326
202337
202348
202359
2023610
2023711
2023812
2023913
20231014
20231115
20231216
2024117

 

1) add a calculated column like:

 

MonthSN = ([Year]*12+[Month])

 

2) plot a slicer with a calculated table like:

 

n = 
SELECTCOLUMNS(
    GENERATESERIES(1,20),
    "n", [Value]
)

 

3) plot a table visual with year and month column and a measure like:

 

CMGA% = 
VAR _currentmonthSN = MAX(data[MonthSN])
VAR _n = SELECTEDVALUE(n[n])
VAR rate =
    DIVIDE(
        SUM(data[value]),
        CALCULATE(
            SUM(data[value]),
            ALL(data),
            data[MonthSN]=_currentmonthSN-_n
        )
    )^(1/_n)
    -1
RETURN
    IF(rate<>-1, rate, "")

 

it worked like:

FreemanZ_0-1683615302968.pngFreemanZ_1-1683615320192.png

 

View solution in original post

2 REPLIES 2
THENNA_41
Post Partisan
Post Partisan

@FreemanZ  Thank you so much . its working 

FreemanZ
Super User
Super User

hi @THENNA_41 

supposing you have a table like:

YearMonthQty
202291
2022102
2022113
2022124
202315
202326
202337
202348
202359
2023610
2023711
2023812
2023913
20231014
20231115
20231216
2024117

 

1) add a calculated column like:

 

MonthSN = ([Year]*12+[Month])

 

2) plot a slicer with a calculated table like:

 

n = 
SELECTCOLUMNS(
    GENERATESERIES(1,20),
    "n", [Value]
)

 

3) plot a table visual with year and month column and a measure like:

 

CMGA% = 
VAR _currentmonthSN = MAX(data[MonthSN])
VAR _n = SELECTEDVALUE(n[n])
VAR rate =
    DIVIDE(
        SUM(data[value]),
        CALCULATE(
            SUM(data[value]),
            ALL(data),
            data[MonthSN]=_currentmonthSN-_n
        )
    )^(1/_n)
    -1
RETURN
    IF(rate<>-1, rate, "")

 

it worked like:

FreemanZ_0-1683615302968.pngFreemanZ_1-1683615320192.png

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

Top Solution Authors