Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi Support,
I need to calculate Top 5 blocks based on IMV Incidents. I can see results ae correct as per DB , but the problem is having Nth posistion is having same number. I have Used TOPN function, but there is a limitaion that
I have used formulas like
Solved! Go to Solution.
Hi @Vandithak , Thank you for reaching out to the Microsoft Community Forum.
Please try below:
IncidentCount_100 =
CALCULATE(
COUNTROWS(factIncidentLog),
IncidentType[IncidentType] = 100
)
RankWithTiebreaker =
RANKX(
ALL(Block[Block_ID]),
[IncidentCount_100] & "-" & Block[Block_ID],
,
DESC,
DENSE
)
Top5Blocks =
IF(
[RankWithTiebreaker] <= 5,
[IncidentCount_100],
BLANK()
)
If it doesn’t help, please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
If this helped solve the issue, please consider marking it “Accept as Solution” and giving a ‘Kudos’ so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi @Vandithak , We are closing this thread as we haven't heard from you in a while, according to our follow-up policy. If you have any more questions, please start a new thread on the Microsoft Fabric Community Forum. We will be happy to assist you! Thank you for being part of the community!
Hi @Vandithak , it's been a while since we last heard from you. We are ready to assist you with resolving the issue, but we need the necessary details from you. Kindly share the information required so we can better understand and address your issue.
Hi @Vandithak ,
I wanted to follow up and see if you’ve had a chance to review the information provided here.
If any of the responses helped solve your issue, please consider marking it "Accept as Solution" and giving it a 'Kudos' to help others easily find it.
Let me know if you have any further questions!
Hi @Vandithak , Thank you for reaching out to the Microsoft Community Forum.
Please try below:
IncidentCount_100 =
CALCULATE(
COUNTROWS(factIncidentLog),
IncidentType[IncidentType] = 100
)
RankWithTiebreaker =
RANKX(
ALL(Block[Block_ID]),
[IncidentCount_100] & "-" & Block[Block_ID],
,
DESC,
DENSE
)
Top5Blocks =
IF(
[RankWithTiebreaker] <= 5,
[IncidentCount_100],
BLANK()
)
If it doesn’t help, please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
If this helped solve the issue, please consider marking it “Accept as Solution” and giving a ‘Kudos’ so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi @v-hashadapu Thanks for providing this. Results are correct as per db, but when i pulled Block id and above formula in bar chart i can see 6 items instead of top 5 . It should display top 5 Blocks onlyeven though the number ties. As per below exmaple 2113 block wont show
Hi @Vandithak , Thank you for reaching out to the Microsoft Community Forum.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot). Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
If this helped solve the issue, please consider marking it “Accept as Solution” and giving a ‘Kudos’ so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi @johnt75 , Thanks for your reply. But the provided dax is not giving Correct results. I just modified Dax provided by you as below ( ORDERBY function not listed in Dax)
Ranking :=
RANKX(
ALLSELECTED(Block[Block_ID]),
CALCULATE(
COUNTROWS(factIncidentLog),
IncidentType[IncidentType] = 100
),
,
DESC,
DENSE
)
RANKX isn't going to work, you can only specify a single sort order metric. You need to use RANK instead.
Hi @Vandithak , Thanks for the update. Can you please confirm if your modified DAX solved the issue. If it did, please mark your reply with the modified DAX "Accept as Solution", so others with similar queries may find it easily. If not, please share the details. Thank you.
The RANK function allows you to use multiple criteria for ranking, so you could use e.g. the Block ID ranked alphanumerically to split ties.
Ranking =
RANK (
ALLSELECTED ( Block[Block_ID] ),
ORDERBY (
CALCULATE ( COUNTROWS ( factIncidentLog ), IncidentType[IncidentType] = 100 ), DESC,
Block[Block_ID], ASC
)
)
Add this measure as a Top N filter on the visuals you want to limit.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
67 | |
58 | |
50 | |
36 | |
34 |
User | Count |
---|---|
84 | |
73 | |
58 | |
45 | |
44 |