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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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