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.
I have a table with employee names called DTM Info, and the column is called Full Name. I have a measure called Total Score which is just every score added together. I want to create a measure to show the Top 10 Employees with the highest scores but I am having difficulty using the TOPN function because it still returns every single employee name with their score, not just the top 10. Could anyone steer me in the right direction?
Solved! Go to Solution.
HI,
Thank you for your message, and please check the below screenshot and the attached pbix file.
I amended to have a measure in the formula.
Show top5 only V2: =
CALCULATE (
[Score total:],
KEEPFILTERS (
WINDOW (
1,
ABS,
5,
ABS,
ALL ( 'Name'[Full Name] ),
ORDERBY ( [Score total:], DESC )
)
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
This pattern should work
=calculate([Total score],Top(5,all('DTM Info'[Full name]),[Total score]),values('DTM Info'[Full name]))
Hope this helps.
Hi,
I am not sure how your datamodel looks like, and how your expected outcome looks like, but I tried to create a sample pbix file like below.
Please check the below picure and the attached pbix file.
I hope the below can provide some ideas on how to create a solution for your datamodel.
Show top5 only: =
CALCULATE (
SUM( Score_fact[Score]),
KEEPFILTERS (
WINDOW (
1,
ABS,
5,
ABS,
ALL ( 'Name'[Full Name] ),
ORDERBY ( CALCULATE( SUM( Score_fact[Score]) ), DESC )
)
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
The Score is stored as a measure called [Total Score] so is there a way you can work that around to work for a measure instead of a column?
HI,
Thank you for your message, and please check the below screenshot and the attached pbix file.
I amended to have a measure in the formula.
Show top5 only V2: =
CALCULATE (
[Score total:],
KEEPFILTERS (
WINDOW (
1,
ABS,
5,
ABS,
ALL ( 'Name'[Full Name] ),
ORDERBY ( [Score total:], DESC )
)
)
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
That works, but it shows everyone elses names (not top 5) afterwards with a weird value. That doesn't matter if there is a way to limit the rows produced to 5. Is there a way that can happen?
Hi,
Thank you for your message, and please check the below picture and the attached pbix file.
I am not sure if I understood your question correctly, but try to deselect unnecessary measures from the visualization.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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 |
---|---|
97 | |
97 | |
82 | |
74 | |
66 |
User | Count |
---|---|
121 | |
105 | |
102 | |
82 | |
72 |