Skip to main content

How to get Top/bottom performer?

Table of Contents

Power BI provides several approaches to determine who your top or bottom performers are including RankX, Rank, and TOPN.
Do note that both the above measures may have to add additional filters either at the visual level or within the measure. On the flip side, TOPN has a simple way to fetch filtered data.

TOPN is not the best option when you want to use the second top or the second from the bottom. It can give you top/bottom 2 easily

However, the most flexible of these is the Index function, which was only established in December 2022. In contrast to its alternatives, the Index function permits the naming of not only the top performer but also the second and third, without needing another filter or measure.

To get the BOTTOM performer:

Bottom = CALCULATE([Gross], KEEPFILTERS(INDEX(1, ALLSELECTED('Item'[Brand]), 
ORDERBY([Gross], ASC))))

To get the SECOND TOP performer:

TOP 2nd = CALCULATE([Gross], KEEPFILTERS(INDEX(2, ALLSELECTED('Item'[Brand]), 
ORDERBY([Gross], DESC))))

Using the Index function in this manner offers a flexible and effective way to analyze your data, eliminating the need for complex additional filters or measures.

Add comment