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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.