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
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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!