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
puru
New Member

Year over Year salary % increase for each employee

Hello everyone,

 

For following situation how can I calculate year over year salary increase in percentage for each employee? 

problem.jpg

 

PLEASE HELP! 

Thanks for any help!

 

 

 

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my solution from here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

You may download my solution from here.

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi unable to access the link... can u share the solution. Have a similar problem to calculate yoy percentage increase in salary of employees 

I do not have that file now.  Share soen data, explain the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Phil_Seamark
Employee
Employee

HI @puru

 

The following calculated column should be close.  Just changed where I have 'Table3' with your own tablename, and make sure you format the column as a percentage.

 

Percentage Change = 
VAR LastYearSalary = 
    CALCULATE(
        SUM('Table3'[Salary]),
        FILTER(
            'Table3',
            'Table3'[Employee] = EARLIER('Table3'[Employee]) &&
            'Table3'[Year] = EARLIER('Table3'[Year])-1)
            )
Var ThisYearSalary =  'Table3'[Salary]          
RETURN IF(NOT ISBLANK(LastYearSalary),DIVIDE( (ThisYearSalary- LastYearSalary) , ThisYearSalary))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

A couple other small points:  YoY is usually calculated as :   LastYear - ThisYear / LastYear.  And Divide function has a third parameter to return an alternate result in case of divide by zero scenario.  So for last line you could do this :

 

RETURN DIVIDE( ThisYearSalary - LastYearSalary , LastYearSalary, 1 )

 

Or if you want to return BLANK(), just omit third parameter. 

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.