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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Top 10 countries slicer in matrix

Hi Team,

I have percentage data by Country and Type. I have to create a slicer which will filter top 10 countries by Category if any option is selected. Please see the below . Also I have attached sample file for reference.

ShaileshK_LT20_0-1655134375768.png

Any help would be appreciated.

https://drive.google.com/file/d/1H_bcoRkQeAwacPUcw5epz5oolmwA1axu/view?usp=sharing

 

Regards,

Shailesh 

6 REPLIES 6
DimaMD
Solution Sage
Solution Sage

Hi,  @Anonymous  Is this your desired result?
Screenshot_18.jpg
I am attaching an example file
PBIX


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
Anonymous
Not applicable

Thank @DimaMD for the reply.

The desire result which I want is to based on "Top 10" slicer selection, I should get top 10 countries by categories (ABC, DEF and XYZ). For example on 26-03-2022, if there no selection in Top 10 slicer then Matrix visual should show all data but if I select "Top 10 country bu ABC" slicer option then in matrix there would Top 10 country based on ABC % data.

I am able to achieve above if I only use Country Name in the matrix but when I add Country name with Type column it is not working.

 

Regards,

Shailesh 

@Anonymous Please review this file.  PBIX
I hope I understand your task


__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com
Anonymous
Not applicable

Hi @DimaMD ,

Thank you for the quick reply. My requirement is to have below matrix table with all data available for the respective date.

ShaileshK_LT20_0-1655821092093.png

 

For example: On 26/03/2022, if there would be no selection in Top 10 slicer then we have 11 countries in the matrix. Now if we select "Top 10 country by ABC" then there would be 10 countries data selected in the matrix based on ABC %.(see the below)

ShaileshK_LT20_1-1655821287195.png

In above screen shot, there are total 10 countries based on the ABC. Similarly if we select "Top 10 country by DEF" OR "Top 10 country by XYZ" then based on the DEF or XYZ percentage data those 10 countries will get selected but it should always have ABC, DEF and XYZ columns available in the matrix based on the top 10 countries selection.

Anonymous
Not applicable

Hi @Anonymous ,

 

Do you want to get a Country list with Top10 countrys based on selections? I suggest you to try this code to create a rank measure.

Rank = 
VAR _RANKABC =
    RANKX (
        CALCULATETABLE ( VALUES ( 'Table'[CountryName] ), ALL ( 'Table' ) ),
        [ABC],
        ,
        DESC,
        SKIP
    )
VAR _RANKDEF =
    RANKX (
        CALCULATETABLE ( VALUES ( 'Table'[CountryName] ), ALL ( 'Table' ) ),
        [DEF],
        ,
        DESC,
        SKIP
    )
VAR _RANKXYZ =
    RANKX (
        CALCULATETABLE ( VALUES ( 'Table'[CountryName] ), ALL ( 'Table' ) ),
        [XYZ],
        ,
        DESC,
        SKIP
    )
RETURN
    SWITCH (
        SELECTEDVALUE ( Top10Table[Top10] ),
        "Top 10 Country by ABC", _RANKABC,
        "Top 10 Country by DEF", _RANKDEF,
        "Top 10 Country by XYZ", _RANKXYZ
    )

Result is as below.

RicoZhou_0-1655363222784.png

 

Best Regards,

Rico Zhou

 

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

 

Anonymous
Not applicable

Hi @Anonymous ,

Thank you for the reply. I have applied "Rank" measure to the my matrix visual but its not working. I am not able to filtered Top 10 country. Could you please help me?

I have highlighted Matrix visual in the below screenshot:

ShaileshK_LT20_0-1655444852205.png

Regards,

Shailesh Kanse

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.