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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Surekha_PM
Helper III
Helper III

CAGR and Linear Guage Visual in Power BI

Hello Everyone,

I am trying to create CAGR formula for last 5 years, next three years and current year. And from this calculation, I need to create a linear gauge chart where I need to put all three metrics to show the performance of the company. Now, I am able to create the formula, but it is not showing me the table based on the sub-category. I am not able to understand what the issue is.

Could you please help me out with this?

Table:

YearSubCategorySalesValue
2018A0
2018B7511700000
2018C283600000
2018D28597000000
2018E0
2018F0
2019A0
2019B8578400000
2019C306200000
2019D31142200000
2019E0
2019F0
2020A0
2020B8449700000
2020C288700000
2020D30270200000
2020E0
2020F0
2021A0
2021B9198300000
2021C307800000
2021D33118600000
2021E0
2021F0
2022A0
2022B10361900000
2022C339900000
2022D36986800000
2022E0
2022F0
2023A0
2023B11550400000
2023C374200000
2023D41096800000
2023E0
2023F0
2024A0
2024B12822500000
2024C411000000
2024D45564000000
2024E0
2024F0
2025A0
2025B14204800000
2025C449900000
2025D50316400000
2025E0
2025F0
2026A0
2026B15687700000
2026C491400000
2026D55408400000
2026E0
2026F0
2027A0
2027B17298900000
2027C529100000
2027D60827300000
2027E0
2027F0
2028A0
2028B19031300000
2028C569300000
2028D66636300000
2028E0
2028F0


Formula:

CAGR % 2018-2023 =
VAR StartYear = 2018
VAR EndYear = 2023
VAR StartingValue = CALCULATE(SUM('Table'[SalesValue]), 'Table'[Year] = StartYear)
VAR EndingValue = CALCULATE(SUM('Table'[SalesValue]), 'Table'[Year] = EndYear)
VAR NoOfYears = EndYear - StartYear

RETURN
IF (
    NOT ISBLANK(StartingValue) && NOT ISBLANK(EndingValue),
    (( (EndingValue / StartingValue) ^ (1 / NoOfYears) ) - 1),
    BLANK()
)


Regards,
Surekha



1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Surekha_PM , 

CAGR for 2018-2023: Create a new measure

 

CAGR_2018_2023 =
VAR StartYear = 2018
VAR EndYear = 2023
VAR NoOfYears = EndYear - StartYear

 

CAGR for current year

CAGR_Current_Year =
VAR StartYear = 2023
VAR EndYear = 2024
VAR NoOfYears = EndYear - StartYear
RETURN
CALCULATE(
(( (SUMX(FILTER('Table', 'Table'[Year] = EndYear), 'Table'[SalesValue]) /
SUMX(FILTER('Table', 'Table'[Year] = StartYear), 'Table'[SalesValue]) ) ^ (1 / NoOfYears) ) - 1),
ALLEXCEPT('Table', 'Table'[SubCategory])
)
RETURN
CALCULATE(
(( (SUMX(FILTER('Table', 'Table'[Year] = EndYear), 'Table'[SalesValue]) /
SUMX(FILTER('Table', 'Table'[Year] = StartYear), 'Table'[SalesValue]) ) ^ (1 / NoOfYears) ) - 1),
ALLEXCEPT('Table', 'Table'[SubCategory])
)

Create similary one more for next 3 years

 

Create a new table that includes the SubCategory and the calculated CAGR values to use in Linear Gauge Chart

CAGR_Table =
SUMMARIZE(
'Table',
'Table'[SubCategory],
"CAGR_2018_2023", [CAGR_2018_2023],
"CAGR_2023_2028", [CAGR_2023_2028],
"CAGR_Current_Year", [CAGR_Current_Year]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@Surekha_PM , 

CAGR for 2018-2023: Create a new measure

 

CAGR_2018_2023 =
VAR StartYear = 2018
VAR EndYear = 2023
VAR NoOfYears = EndYear - StartYear

 

CAGR for current year

CAGR_Current_Year =
VAR StartYear = 2023
VAR EndYear = 2024
VAR NoOfYears = EndYear - StartYear
RETURN
CALCULATE(
(( (SUMX(FILTER('Table', 'Table'[Year] = EndYear), 'Table'[SalesValue]) /
SUMX(FILTER('Table', 'Table'[Year] = StartYear), 'Table'[SalesValue]) ) ^ (1 / NoOfYears) ) - 1),
ALLEXCEPT('Table', 'Table'[SubCategory])
)
RETURN
CALCULATE(
(( (SUMX(FILTER('Table', 'Table'[Year] = EndYear), 'Table'[SalesValue]) /
SUMX(FILTER('Table', 'Table'[Year] = StartYear), 'Table'[SalesValue]) ) ^ (1 / NoOfYears) ) - 1),
ALLEXCEPT('Table', 'Table'[SubCategory])
)

Create similary one more for next 3 years

 

Create a new table that includes the SubCategory and the calculated CAGR values to use in Linear Gauge Chart

CAGR_Table =
SUMMARIZE(
'Table',
'Table'[SubCategory],
"CAGR_2018_2023", [CAGR_2018_2023],
"CAGR_2023_2028", [CAGR_2023_2028],
"CAGR_Current_Year", [CAGR_Current_Year]
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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