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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
PauloRicardo
Frequent Visitor

Subtracting the highest value for each value below to find the difference for each

Hi guys,

  In the same job position i have different salary, i already found the highest value (i used MAX). Now i need help finding how to subtract the highest value for each salary below to find the difference.

RoleNameFemale SalaryMale SalaryGoal
AdministrativeJulia2.350 0
AdministrativeRobert 2.150200
AdministrativeJohn 2.200150
AdministrativeSandra2.100 250
Total---------600


Any help?

2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@PauloRicardo 

select role and name column , and unpivot other column in PQ

11.png12.PNG

 

then use DAX to create a column

 

Column = max('Table'[Value])-'Table'[Value]
13.PNG
 
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

v-tangjie-msft
Community Support
Community Support

Hi @PauloRicardo ,

 

Thanks @ryan_mayu  for the quick reply and solution.


I have some other ideas for you to refer. We  can create a calculated column in Desktop.

SalaryGoal = 
var _1=MAX('Table'[Female Salary])
var _2=MAX('Table'[Male Salary])
var _max=IF(_1>=_2,_1,_2)
var _salary=[Female Salary]+[Male Salary]
RETURN _max-_salary

Then the result is as follows.

vtangjiemsft_0-1713423594164.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

2 REPLIES 2
v-tangjie-msft
Community Support
Community Support

Hi @PauloRicardo ,

 

Thanks @ryan_mayu  for the quick reply and solution.


I have some other ideas for you to refer. We  can create a calculated column in Desktop.

SalaryGoal = 
var _1=MAX('Table'[Female Salary])
var _2=MAX('Table'[Male Salary])
var _max=IF(_1>=_2,_1,_2)
var _salary=[Female Salary]+[Male Salary]
RETURN _max-_salary

Then the result is as follows.

vtangjiemsft_0-1713423594164.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

ryan_mayu
Super User
Super User

@PauloRicardo 

select role and name column , and unpivot other column in PQ

11.png12.PNG

 

then use DAX to create a column

 

Column = max('Table'[Value])-'Table'[Value]
13.PNG
 
 
pls see the attachment below




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors