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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Slicer measure to choose top n

Hello,

 

I have a scatter chart which displays data for 86 sectors 'Dim: Sector 1-96' [Sector] of the economy. 

 

I would like to use a slicer that will allow users to select the top 5, 10, 15, 20 or all sectors. I've prepared a table and slicer (see image below), but I haven't figured out how to link this to the scatter chart. 

 

It would be really helpful if someone could suggest a measure so when the slicer is selected it would filter the scatter chart depending on the selection. 

 

Regards,

Brent

 

 

 

Brent_C_2-1627877303503.png

 

 

 

 

 

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

You can refer the content in the following links to get it:

How to Create Power BI TOP N Report (Variable TOP N Filter)

Find Lists Of Your Top Clients Across Difference Measures w/DAX in Power BI

Filter top n records Power BI

And the following blog explain that how to get the top N and other items, hope it can give you other insight or clue...

Filtering the top products alongside the other products in Power BI

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , Assume you can create a what if parameter Rankval and use that in a new measure

 

M2 = CALCULATE( [meausre],TOPN(selectedvalues(Rankval[Rankval]),allselected('Dim: Sector 1-96' [Sector]),[meausre],DESC), values('Dim: Sector 1-96' [Sector]))

 

refer if needed

https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415

Anonymous
Not applicable

Hi @amitchandak and thanks for your assistance. To be honest I am not familiar with the what if rank val, so I'm struggling to work it out. Any further help would be great. 

@Anonymous , Sorry for the confusion.  Rankval is whatif parameter, You can use the value of what-if parameter in that place

 

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.