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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Microsoft Employee
Microsoft 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
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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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