Forum Discussion
NumeroENAP
Helper III
6 years agoTOPN by city
Hi, I'm having problem with the use of TOPN, for some reason. Here is an exemple of my model : Employe City % John Buffalo 40% Julia Buffalo 38% Pedro San Jose 38% ...
- 6 years ago
I succeeded! I used that formula :
TOP2RANK = CALCULATE(
SUM('Table'[%]
);
TOPN(2;'Table';'Table[created_index];DESC
)
)Of course, I sorted my table with Power Query first.
Anonymous
6 years agoNot applicable
Can you share the sample data and what output you are getting when you click on top N.
NumeroENAP
Helper III
6 years agoDate sample
| Employee | City | % |
| Jake | Boston | 0,93203883 |
| Martin | Tampa Bay | 0,92977099 |
| James | Nashville | 0,92857143 |
| Tuukka | Calgary | 0,92785105 |
| Braden | Edmonton | 0,92517986 |
| Connor | Minnesota | 0,92410401 |
| Devan | Toronto | 0,92271819 |
| Corey | Florida | 0,92125984 |
| Mike | Minnesota | 0,90125984 |
What I get from my report (FILTER : City, Filter type : TOP N, # : 2, by value : %)
| Employee | City | % |
| Connor | Minnesota | 0,924 |
| Mike | Minnesota | 0,920 |
- TheDataMustFlow6 years agoFrequent Visitor
When you put the data in a matrix with the city as columns, do you get one or two columns for Minnesota?
If you get two it's probably because there's a trailing space in a row somewhere in your data in the city column.
Try to clean up your data (trim the city column) and see if the problem persists.
- NumeroENAP6 years ago
Helper III
I only have one column for minnesota and my datas are pretty clean 😞
- NumeroENAP6 years ago
Helper III
I succeeded! I used that formula :
TOP2RANK = CALCULATE(
SUM('Table'[%]
);
TOPN(2;'Table';'Table[created_index];DESC
)
)Of course, I sorted my table with Power Query first.