Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi, I am calculating the contribution margin in the "Service" table using the following measure:
DB per FTE =
DIVIDE([Revenues minus salary costs], SUM('PersonnelDataCombined'[FTE yearly]))
I now want to get an average of the two best values (per year) as a target. I have already tried with the Rankx formula:
Rank = rankx(all('locations'[district]),[DB per FTE])
and thus get the rank as well.
But how can i now display the sum of the two best values in each case divided by 2 as a measure or value?
Solved! Go to Solution.
Hi, @GeorgW
Please try the below.
average of top2 =
AVERAGEX (
TOPN ( 2, ALL ( 'locations'[district] ), [DB per FTE], DESC ),
[DB per FTE]
)
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Thank you!
Hi, @GeorgW
Please try the below.
average of top2 =
AVERAGEX (
TOPN ( 2, ALL ( 'locations'[district] ), [DB per FTE], DESC ),
[DB per FTE]
)
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 39 | |
| 34 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 122 | |
| 111 | |
| 83 | |
| 69 | |
| 68 |