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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
nsaray
Helper II
Helper II

Show Top 10 rows in a filtered table

Hi

This seems easy to do but all the solutions I have tried to research don't seem to work for me. All I want to do is display the top 10 rows in a table based on Exposure Gap, descending. The number of rows can change from month to month. For each month selected, I want to show the top 10 for that particular month.

 

Thanks for your help!

 

nsaray_0-1626966258471.png

 

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

RANK =
RANKX(
    ALLSELECTED( yourtable[MARG ID] ),
    CALCULATE( SUM( yourtable[Exposure Gap] ) )
)

Put the measure into the visual filter

Screenshot 2021-07-22 182114.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

5 REPLIES 5
CNENFRNL
Community Champion
Community Champion

RANK =
RANKX(
    ALLSELECTED( yourtable[MARG ID] ),
    CALCULATE( SUM( yourtable[Exposure Gap] ) )
)

Put the measure into the visual filter

Screenshot 2021-07-22 182114.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Hi

 

Thanks, I've tried that but it's still displaying lots and lots of rows. Any idea what i'm doing wrong?

nsaray_1-1626974337503.png

 

nsaray_0-1626974296391.png

 

fhill
Resident Rockstar
Resident Rockstar

I'm assuming you've tried the built-in 'Top N' filtering?  

 

 

fhill_0-1626974710160.png

 




Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




yep tried that 😞

ok figured out what the problem was. there were multiple Marg IDs in the dataset and so it was returning every row associated with that Marg ID instead of only the top Exposure Gaps

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.