Forum Discussion
rebecka
6 years agoFrequent Visitor
Top N Table
Hi, Is there a way to create a table in Power Query to get Top N organizations dynamically? I have some visuals and I want them all to present data from my Top N organizations, but Top N organizati...
v-juanli-msft
6 years agoCommunity Support
Hi rebecka
Create measures
AntalEval_name = CALCULATE(COUNT(Sheet9[key]),FILTER(ALLSELECTED(Sheet9),Sheet9[name]=MAX(Sheet9[name])))
AntalEval_result = CALCULATE(COUNT(Sheet9[key]),FILTER(ALLSELECTED(Sheet9),Sheet9[result]=MAX(Sheet9[result])))
OrgRankByTopN = RANKX(ALLSELECTED(Sheet9),[AntalEval_name],,DESC,Dense)
SelectedTopNNumber = IF(HASONEVALUE('top n'[top n]),SELECTEDVALUE('top n'[top n]),10)
ShouldOrgBeIncluded = IF([OrgRankByTopN]<=[SelectedTopNNumber],1,0)
Add "AntalEval_name" and "name" in one visual,
add "AntalEval_result" and "result" in another visual.
Best Regards
Maggie
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
rebecka
6 years agoFrequent Visitor
No that's not really what I'm looking for. The first visual is correct!
We can see that f, d, b, c and e are my Top N (3) organizations and therefore I want their result presented in the other visual. I want the highlighted yellow numbers in the below figure.
So the other visual should present
Bad: 3
Better: 8
Good: 3
Worse: 4
Since that is the result of my Top N organizations.
I hope I explanied it better this time!
Best Regards,
Rebecka