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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aempa
Frequent Visitor

Growth % in time events

Hello

 

I have already calculated the salary expenses of my employees over time, with a formula that I show below. Now I want to calculate a growth rate of the salary expenses, over the years and the months.

 

I use the formula below to create a measure and know the salary expenses over time.

CurrentSalary sum=  
VAR currentDate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
SUM ( 'salary'[Amount] );
FILTER ( 'Salary'; 'Salary'[Start] <= currentDate && 'Salary'[End] >= currentDate )
) )

 

In my database, each employee has several lines with the registration of the various salaries they have received over time.

 

Employee

Start

End

Salary

1

01/01/2005

31/12/2005

 1 900,00 €

1

01/01/2006

31/12/2006

 1 950,00 €

1

01/01/2007

31/12/2007

 2 000,00 €

1

01/01/2008

31/12/2015

 2 050,00 €

1

01/01/2016

31/12/9999

 2 100,00 €

2

01/01/2014

31/12/2015

 5 250,00 €

2

01/02/2010

31/12/2013

 2 000,00 €

2

01/01/2016

31/12/9999

 5 250,00 €

3

01/10/2008

31/12/2009

 950,00 €

3

01/01/2010

31/03/2010

 1 000,00 €

3

01/04/2010

30/09/2010

 1 200,00 €

3

01/10/2010

31/07/2011

 1 390,00 €

3

01/03/2014

30/04/2015

 2 680,00 €

3

01/08/2011

28/02/2014

 2 600,00 €

3

01/05/2015

31/12/2015

 4 000,00 €

3

01/01/2016

31/12/9999

 4 500,00 €

 

2 ACCEPTED SOLUTIONS
aempa
Frequent Visitor

Thank you @spuder. I'm sorry to have so many questions.

 

I Tried but the result are 0%, any tips?

 Capturar.PNG

View solution in original post

In your measure you try to sum up the column [Montante]. But for the totals you need to sum up the column [Salary Atual soma]

View solution in original post

8 REPLIES 8
spuder
Resolver IV
Resolver IV

Hi aempa, 

 

as long your salary always become bigger you can create a calculated column like this.


Groth = var actual = CALCULATE(MAX(Tabelle2[Salary]);Tabelle2[Employee]=EARLIER(Tabelle2[Employee])) var last = CALCULATE(MAX(Tabelle2[Salary]);FILTER(ALL(Tabelle2);Tabelle2[Start]<EARLIER(Tabelle2[Start]));Tabelle2[Employee]=EARLIER(Tabelle2[Employee])) return FORMAT(DIVIDE(actual;last;1);"percent")

example.jpg 

aempa
Frequent Visitor

Thank you @spuder, but I don't understand in line 1 and 2, the difference between the two values aren't 102%. Am I reading the data correctly?

 

 

1950 is 102,63% of 1900 (1950*100/1900)

 

If you wish just the groth you have to divide by 100%

 

so the result would be 2,63%.

 

Or am I wrong with your needs?

aempa
Frequent Visitor

Sorry, I am a little rookie on this. 

 

I want to know the growth between January and February or 2012 and 2013.

 

In this moment, I have this results:

I can't link the date table because my "Salary atual soma" are influence negatively.

Capturar.PNG

 

In this scenario I would choose the following approach.

 

Using PREVIOUSMONTH() and PREVIOUSYEAR()

 

example.jpg

aempa
Frequent Visitor

Thank you @spuder. I'm sorry to have so many questions.

 

I Tried but the result are 0%, any tips?

 Capturar.PNG

In your measure you try to sum up the column [Montante]. But for the totals you need to sum up the column [Salary Atual soma]

aempa
Frequent Visitor

Thank you for your patience @spuder. Your solution was perfect.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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