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, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
STIBBS_807
Resolver I
Resolver I

Simple Growth Measure

I have the following data that I would like to do a growth % for:

 

Year     Totals  Case Type      Year End

20171420Intake31/12/2017
20181520Intake31/12/2018
20191358Intake31/12/2019
20201079Intake31/12/2020
2021802Intake31/12/2021
2017557Investigation31/12/2017
2018473Investigation31/12/2018
2019421Investigation31/12/2019
2020410Investigation31/12/2020
2021336Investigation31/12/2021
2017233Ongoing31/12/2017
2018186Ongoing31/12/2018
2019154Ongoing31/12/2019
2020145Ongoing31/12/2020
2021122Ongoing31/12/2021

 

Measure 1  is:

Prev Year= CALCULATE(SUM('TABLE NAME'[Totals]),SAMEPERIODLASTYEAR('TABLE NAME'[Year End]))

 

Measure 2 is:

%Growth =CALCULATE(DIVIDE(SUM('TABLE NAME'[Totals])- [Prev Year],[Prev Year])*1)

 

I am not getting my Prev Year value in the column.  I get an over all total of 1151 and zero growth.😫

 

Here is the results that I would like to get:😀

YearTotalsPrev Year%Growth
20172210  
201821792210-1%
201919332179-11%
202016341933-15%
202112601634-23%

 

Please review my measures and tell me what I am missing.  Thank you.

 

Alternatively I would like to see this:

Case TypeYearTotalsPrev YearGrowth%
Intake20171420  
Intake2018152014207%
Intake201913581520-11%
Intake202010791358-21%
Intake20218021079-26%
Investigation2017557  
Investigation2018473557-15%
Investigation2019421473-11%
Investigation2020410421-3%
Investigation2021336410-18%
Ongoing2017233  
Ongoing2018186233-20%
Ongoing2019154186-17%
Ongoing2020145154-6%
Ongoing2021122145-16%

I have Filters on my page so I can use that to get the Case Types if this is not achievable. 

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@STIBBS_807  Do you have a DimDate table? https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

Time Intelligence is MUCH easier with a date table. 

 

Follow the instructions in my blog if you don't have one, then try these measures: 

 

Total Value = SUM('TABLE NAME'[Totals])

PY Total Value = CALCULATE ( [Total Value] , DATEADD( DimDate[Date], -1, YEAR) )

% Growth Totals = DIVIDE( [Total Value] - [PY Total Value], [PY Total Value] )

 

Make sure you use that % Growth within the context of a Year or date slicer/visual.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

5 REPLIES 5
STIBBS_807
Resolver I
Resolver I

Found my Problem.  The calendar table that I imported was not defined as a Date Table.  Once I did that all when well.  Thank you for your assistance and patience.

@STIBBS_807 Glad you got it working - that mark as date table is a hidden trick that catches a lot of people. I struggled with it for ages when I started learning Power BI and couldn't figure out why my calculations weren't working!


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

STIBBS_807
Resolver I
Resolver I

Almost there.  Now I have the totals but the Previous Year do not line up correctly.

 

Total IIO = SUM('Table Name'[Totals])
PY IIO = CALCULATE([Total IIO],DATEADD('Calendar'[Date],-1,YEAR))
IIO %Growth = CALCULATE( divide(([Total IIO] -[PY IIO]),[PY IIO]))
STIBBS_807_1-1633704399768.png

 My Calendar table is set up like so:

STIBBS_807_2-1633704500846.png

So I am not sure What I have done wrong in the Matrix.  Do I have my Calendar Table set up incorrectly?

STIBBS_807
Resolver I
Resolver I

Thank you.  I do have a DimDate table set up.   I will try your solution and let you know if it works for me.

AllisonKennedy
Super User
Super User

@STIBBS_807  Do you have a DimDate table? https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

Time Intelligence is MUCH easier with a date table. 

 

Follow the instructions in my blog if you don't have one, then try these measures: 

 

Total Value = SUM('TABLE NAME'[Totals])

PY Total Value = CALCULATE ( [Total Value] , DATEADD( DimDate[Date], -1, YEAR) )

% Growth Totals = DIVIDE( [Total Value] - [PY Total Value], [PY Total Value] )

 

Make sure you use that % Growth within the context of a Year or date slicer/visual.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
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.

October NL Carousel

Fabric Community Update - October 2024

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