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