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
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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.