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
nikttk
Regular Visitor

Need help creating TopN and other(slicer)

Hi,

I want to create a TopN rank and others(slicer), if selected top3 only top3 data should be show and effecting other visualizers too, also if i click focusing on the other visualize(ex.piechart - Android) the top3 should be recalculated to be top3 on Android user(still ranking by Country)

 

like the picture I've attached here :

Capture.PNG

I'm attracting the dummy data I've used to create here 

Data.xlsx

 

Thanks,

6 REPLIES 6
v-lili6-msft
Community Support
Community Support

hi @nikttk 

You could create a rank measure as below:

Rank = 
var _type= IF(RANKX(ALLSELECTED('Table'[Country]),[Top3Register],,DESC)<=3,"Top3","Other") 
var _table=FILTER(CROSSJOIN(SUMMARIZE('Table','Table'[Country],"_name",_type),'Type'),[_name]=[Name])  return
MAXX(_table,[_name])

Then use this rank measure instead of your [Register_rank]

 

Regards,

Lin

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

Hi @v-lili6-msft

Thanks for the reply and guide, but may I ask where does [Name] come from ?

 

Thanks

HI  @nikttk 

3.JPG

and here is my sample pbix file, please try it.

 

Regards,

Lin

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

Hi @v-lili6-msft 

Thanks again for helping and sorry for my bad, btw according to your pbix file when selecting top3 the pie chart seem to still not affected by ranking, do you have any suggestion ?

 

Thanks

hi  @nikttk 

That because you have very little sample data, you could add more sample data in the data model.

 

By the way, just adjust the measure [Top3Register] in the sample pbix file, use SUM instead of COUNTA.

Top3Register = CALCULATE(SUM('Table'[UserID]))

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
harshnathani
Community Champion
Community Champion

Hi @nikttk ,

 

You can have a look at the below video.

 

https://www.youtube.com/watch?v=UAnylK9bm1I

 

 

Regards,

Harsh Nathani

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.