Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Top 10 values in Matrix visual

Hi Community..!!

Please refer a below image.This is a matrix visual

 

 

I want to display top10 columns, expect both side left colored columns (these are PY and CY share).

I am using share% measure to display top 10 columns into the matrix visual. The columns which are red in color (PY and CY) should be constant and remaining in between columns should be top 10 (number of columns = 10).

Can we achieve this in to the matrix visual?

please help me to solve this.

  • Hi, Anonymous 

    You need a rank measure first:

    Rank =
    VAR tab =
        SUMMARIZE ( ALL ( Sheet1 ), Sheet1[Row], "_Share", Sheet1[share%] )
    RETURN
        RANKX ( tab, Sheet1[share%],, DESC, DENSE )
    

    Then you may need to create multiple measure to replace your original column values.

    Similar to the following:

    New Column2 =
    IF ( [Rank] <= 10, SUM ( 'Sheet1'[Column2] ), BLANK () )
    
    New Column3 =
    IF ( [Rank] <= 10, SUM ( 'Sheet1'[Column3] ), BLANK () )

    .....

    If it doesn't work, please share a sample pbix file for further research.

    Best Regards,
    Community Support Team _ Eason

     

4 Replies

  • v-easonf-msft's avatar
    v-easonf-msft
    Community Support

    Hi, Anonymous 

    Not fully sure what you mant.

    Please check if 'TopN' in visual filter pane could work for you.

     

    Best Regards,
    Community Support Team _ Eason

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-easonf-msft 
      If I go with the option that u have mentioned above then I will get top10 for all the bars.
      my queston is, left  and right most column will be constant(red in border). Expect these columns I want top10 columns in between them.
      I Hope now u are clear with the requirement.

      • v-easonf-msft's avatar
        v-easonf-msft
        Community Support

        Hi, Anonymous 

        You need a rank measure first:

        Rank =
        VAR tab =
            SUMMARIZE ( ALL ( Sheet1 ), Sheet1[Row], "_Share", Sheet1[share%] )
        RETURN
            RANKX ( tab, Sheet1[share%],, DESC, DENSE )
        

        Then you may need to create multiple measure to replace your original column values.

        Similar to the following:

        New Column2 =
        IF ( [Rank] <= 10, SUM ( 'Sheet1'[Column2] ), BLANK () )
        
        New Column3 =
        IF ( [Rank] <= 10, SUM ( 'Sheet1'[Column3] ), BLANK () )

        .....

        If it doesn't work, please share a sample pbix file for further research.

        Best Regards,
        Community Support Team _ Eason