The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Any help would be appreciated.
https://drive.google.com/file/d/1H_bcoRkQeAwacPUcw5epz5oolmwA1axu/view?usp=sharing
Regards,
Shailesh
Hi, @Anonymous Is this your desired result?
I am attaching an example file
PBIX
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
Hi @DimaMD ,
Thank you for the quick reply. My requirement is to have below matrix table with all data available for the respective date.
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)
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.
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.
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.
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:
Regards,
Shailesh Kanse