Forum Discussion

amikm's avatar
amikm
Icon for Helper V rankHelper V
4 years ago
Solved

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:

 

 

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.

 

 

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


My expected output would be-

 

 

Thanks

 

 

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

     

    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

2 Replies

  • v-janeyg-msft's avatar
    v-janeyg-msft
    Icon for Community Support rankCommunity 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
    )
    

     

    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