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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
PauloRicardo
Helper I
Helper I

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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.