Forum Discussion
Difference between 2 calculated values
Hi Team,
I'm new to DAX and appreciate some help.
I am trying to calculate the difference between FTE Salary Compa Ratio for Female to Male.
I have created towo calculated fields to average filter on Male and another for female as below.
All I'd like to do is get the difference between the two below calcs and divide the total by FTE Salary Compa Ratio. so basically Female FTE Salary Compa Ratio - Male FTE Salary Compa Ratio divided by FTE Salary Compa Ratio.
Female FTE Salary Compa Ratio =
CALCULATE(
AVERAGE('Report_Entry'[FTE Salary Compa Ratio]),
'Report_Entry'[Gender] IN { "Female" }
)
Male FTE Salary Compa Ratio =
CALCULATE(
AVERAGE('Report_Entry'[FTE Salary Compa Ratio]),
'Report_Entry'[Gender] IN { "Male" }
)
so my total outcome should come something like this.
| Region | Average of FTE Salary Compa Ratio | Female FTE Salary Compa Ratio | Male FTE Salary Compa Ratio | Difference |
| Australia | 1.0085 | 0.9304 | 0.9571 | -0.02647 |
Hi Anonymous
Try this:
Measure =([Female FTE Salary Compa Ratio]-[Male FTE Salary Compa Ratio])/AVERAGE('Report_Entry'[FTE Salary Compa Ratio])
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/Iman Jan Anonymous
Change the format to percentage.
Select the measure that you created, then change the format:
The other way is to use Format DAX formula:
https://docs.microsoft.com/en-us/dax/format-function-dax
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
5 Replies
- AnonymousNot applicable
legend thank you Vahid Agha 😊
- VahidDMSuper User
Thanks Iman Jan 🙂
- VahidDMSuper User
Hi Anonymous
Try this:
Measure =([Female FTE Salary Compa Ratio]-[Male FTE Salary Compa Ratio])/AVERAGE('Report_Entry'[FTE Salary Compa Ratio])
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/- AnonymousNot applicable
Thank you Vahid.
Last question.
How would i show that as a percent?- VahidDMSuper User
Iman Jan Anonymous
Change the format to percentage.
Select the measure that you created, then change the format:
The other way is to use Format DAX formula:
https://docs.microsoft.com/en-us/dax/format-function-dax
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/