Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
1001
Resolver II
Resolver II

Trying to Write a TopN Measure

Hi All,

I have a caclulated column in my Sales table of Over Odered values. I've then created a table visual with Suppliers in rows and Over Orders as a column. I now wish to just display the Top 5 Over Orders in that table visual. How am I able to achieve this? 

 

Thanks. 

1 ACCEPTED SOLUTION

Hi Jiwan, I ended up cheating a little. As you can see from the image (suppliers blurred), I just sorted the graphic highest to lowest and resized the table to only view first four rows. I just thought a measure may simplyfy me resizing the table.  Many thanks.

Untitled2.jpg 

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your dataset.

 

Untitled.png

 

Top five over ordered: =
CALCULATE (
    [Over ordered measure:],
    KEEPFILTERS (
        TOPN ( 5, ALL ( Sales[Suppliers] ), [Over ordered measure:], DESC )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi Jiwan, I ended up cheating a little. As you can see from the image (suppliers blurred), I just sorted the graphic highest to lowest and resized the table to only view first four rows. I just thought a measure may simplyfy me resizing the table.  Many thanks.

Untitled2.jpg 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.