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.
Hello,
I have data that looks like this:
Employee | Employment | Age |
1 | a | 35 |
1 | b | 35 |
2 | a | 40 |
3 | a | |
4 | a | 51 |
4 | b | 51 |
I want to calculate the median age of the individual employees. Simply taking the median of age column is not good, since it counts Employee 1 and 4's ages twice.
I need a measure that counts distinct values in the employee column, then takes their median age. (Employees with blank age shouldn't be calculated)
Any idea about a formula that could do this?
Thanks!
Solved! Go to Solution.
I think this should work
calculate(Medianx(values(table[employee]),calculate(average(table[age]))),table[age]>0)
I think this should work
calculate(Medianx(values(table[employee]),calculate(average(table[age]))),table[age]>0)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |