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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
oakfootballclub
Helper IV
Helper IV

how to create a slicer based on measure

Hi experts, I want to create a rank measure, the rank is based on ytd amount and ordered descending,

here is the measure I created: 

RANK(DENSE,ALLSELECTED(fact[gpn])  ,ORDERBY([cal_ytd],DESC),,,)

I also want to make the rank as a slicer, I created a column use the same code, but it signs run out of memory even I filtered raw data.

oakfootballclub_0-1717054378658.png

 

do you have a solution to create such a top x slicer? for example, when I select 50, the following table or matrix show ranked 1 to 50.

Thank you.

 

1 REPLY 1
amitchandak
Super User
Super User

@oakfootballclub , You can use TOPN for That

 

Calculate([cal_ytd], keepfilter(TOPN(50, ALLSELECTED(fact[gpn]), [cal_ytd], desc) ) )

 

You can replace 50 with a selectedvalue in the slicer. You can also use the WIndow function for the same 

 

Dynamic TOPN using TOPN/Window and Numeric parameter: https://youtu.be/vm2mdEioQPQ

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors
Top Kudoed Authors