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
melhajj
Helper I
Helper I

How to calculate percentage increase between two columns ?

Greetings,

 

I have a table with employee number , old salary and new salary. I want to calculate the percentage increase of the employees salary , any guidance please on how to create the measure for this ?

 

Screen Shot 2020-07-31 at 3.24.44 PM.png

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

 

Create Measure, copy in the following, Ensure you update table name and column name if needed. 

 

b % difference from a = 
VAR __BASELINE_VALUE = SUM('Table Name'[Max of OLD_PROPOSED_SALARY_N])
VAR __VALUE_TO_COMPARE = SUM('Table Name'[Max of PROPOSED_SALARY_N])
RETURN
	DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)

 

 

View solution in original post

az38
Community Champion
Community Champion

@melhajj 

it depends on your data model. for example, do you have dates in your table?

in the most common case you can create a measure

Measure = 
DIVIDE(
CALCULATE(MAX(Table[Salary]), ALLEXCEPT(Table, Table[EMPLOYEE_NUMBER]) ),
CALCULATE(MIN(Table[Salary]), ALLEXCEPT(Table, Table[EMPLOYEE_NUMBER]) )
)
- 1

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

2 REPLIES 2
az38
Community Champion
Community Champion

@melhajj 

it depends on your data model. for example, do you have dates in your table?

in the most common case you can create a measure

Measure = 
DIVIDE(
CALCULATE(MAX(Table[Salary]), ALLEXCEPT(Table, Table[EMPLOYEE_NUMBER]) ),
CALCULATE(MIN(Table[Salary]), ALLEXCEPT(Table, Table[EMPLOYEE_NUMBER]) )
)
- 1

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

 

Create Measure, copy in the following, Ensure you update table name and column name if needed. 

 

b % difference from a = 
VAR __BASELINE_VALUE = SUM('Table Name'[Max of OLD_PROPOSED_SALARY_N])
VAR __VALUE_TO_COMPARE = SUM('Table Name'[Max of PROPOSED_SALARY_N])
RETURN
	DIVIDE(__VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE)

 

 

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.