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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
amikm
Helper V
Helper V

Issue with table visual with multiple selection in slicer

I am trying to get the top 5 Marks for the years 2021 and year 2022.

 

Here is the problem statement:

 

amikm_0-1649164487403.png

 

When I am selecting an Individual year, I am getting the top 5 marks from the table, but when I am selecting both year from the Slicer, I am not getting the expected output. I am using the TOP N filter from the Filter panel for Marks.

 

amikm_1-1649164613966.png

 

Note: I have 1000+ rows like this in the real dataset, this is just for the sample.


My expected output would be-

amikm_3-1649164722470.png

 

 

Thanks

 

 

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @amikm 

 

According to your description, I think you can create a measure and use it in filter pane to display the top 5.

Like this:

Top5 =
RANKX (
    SUMMARIZE ( ALLSELECTED ( 'Table Top' ), [Year], [Name] ),
    CALCULATE ( SUM ( 'Table Top'[Marks] ) ),
    ,
    desc,
    DENSE
)

vjaneygmsft_0-1649403404501.png

 

vjaneygmsft_0-1649403131933.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

View solution in original post

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @amikm 

 

According to your description, I think you can create a measure and use it in filter pane to display the top 5.

Like this:

Top5 =
RANKX (
    SUMMARIZE ( ALLSELECTED ( 'Table Top' ), [Year], [Name] ),
    CALCULATE ( SUM ( 'Table Top'[Marks] ) ),
    ,
    desc,
    DENSE
)

vjaneygmsft_0-1649403404501.png

 

vjaneygmsft_0-1649403131933.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

amitchandak
Super User
Super User

@amikm , Assume you have measure marks, Create rank like this

 

rankx(filter(summarize(allselecetd(Table), Table[year], Table[name]), [year] = max([year])), [marks],,desc,dense)

 

if you need across year

rankx(summarize(allselecetd(Table), Table[year], Table[name])), [marks],,desc,dense)

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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