TOPN(N, Table, OrderBy) returns the first N rows of a table, ordered by an expression, largest first unless you add ASC.
As a CALCULATE filter, it limits a measure to the top rows:
Top 3 Sales = CALCULATE([Total Sales], TOPN(3, ALL(Product[Product]), [Total Sales]))
Use ALL inside, so every product competes even when the row is a single product. In a table by region, the top 3 are worked out per region, because [Total Sales] follows the region filter.
As a calculated table, TOPN keeps a list: TOPN(5, SUMMARIZE(Sales, Product[Product], "Sales", [Total Sales]), [Sales]).
The edge case: ties. If the fifth and sixth products have the same value, TOPN returns both, six rows. The Top N filter in the Filters pane does the same.