Forum Discussion
spuri_78
2 years agoRegular Visitor
Median and Distinct
Hi all, I'm having difficultiues calculating median of employee sick hours. The measure I have in place is Sick Hours Median = MEDIAN('T Sick'[SumOfSick Hours]). The table has Emp Id, Sur...
- 2 years ago
Try this:
Sick Hours Median =
MEDIANX(
VALUES('T Sick'[Emp Id]),
CALCULATE(SUM('T Sick'[SumOfSick Hours]))
)
spuri_78
2 years agoRegular Visitor
Absolute legend, my friend - mind explaining the formula a bit?
Shravan133
2 years agoSuper User
- VALUES('T Sick'[Emp Id]) ensures that we are calculating the median across distinct employees.
- CALCULATE(SUM('T Sick'[SumOfSick Hours])) calculates the sum of sick hours for each employee.
- MEDIANX then calculates the median across those individual sums for each employee.