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
I have two fields "Success" and "Fail" that count the number of Succeeded/Failed tasks for companies. For example a company might have 5 Succeeded and 5 Failed tasks. I wanted to make two graphs to show the % of success and fail for each company, and since they either succeed or fail I made two measures as follows:
%Success = count(Success) / (count(Success)+count(Fail))
%Fail = count(Fail) / (count(Success)+count(Fail))
I then put them in two graphs, with Y axis the % and Y axis the company. They give the correct %, so far so good.
However I want to show only the top 10 companies by percentage, so I put a filter top N = 10 by value "%Success" on one and "%Fail" on the other. For the %Fail graph this works just as intended, giving me the top 10 result with highest %Fail. However when doing exactly the same for %Success it instead of taking top N highest %, it takes the top N highest count (number of succeeded tasks).
This means a company that has 10 Success and 90 Fails (making it just 10%) will be shown before a company that have only 1 success but no fail (making it 100%).
I am confused why it works different for the two graphs when I have set them up exactly the same, and the measure is calculated the same way.
This becomes evident as if I sort top 10, there will be two in the top with 100% and then the third place at 93%, but if I then increase to top 20, I suddenly have a lot of new companies at 100% that were previously now shown because they had fewer # than the others with lower %.
And again, this works for the %Fail graph. It has four with 100% in the top 10, and if I switch to top 20, the top 10 remains the same as they were already top ranked by % (but not being by number).
Solved! Go to Solution.
Hello, thanks for the suggestion.
I finally solved the problem, sadly before I read your suggestion so I am not sure if that would have helped too. My problem was due to the ACCOUNTNUM the filter was on top of having issues on its own, after I switched to another filter it worked as intended.
@Dushatar , is % Automated a measure? It should be measure not column
Try TOP N function and check
CALCULATE( [% Automated] ,TOPN(10,allselected('Table'[AccountNUM]), [% Automated] ,DESC),values('Table'[AccountNUM]))
Hello, thanks for the suggestion.
I finally solved the problem, sadly before I read your suggestion so I am not sure if that would have helped too. My problem was due to the ACCOUNTNUM the filter was on top of having issues on its own, after I switched to another filter it worked as intended.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |