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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aizamkamadin
Helper II
Helper II

How to show above 4 country on selected/filtered value

pbifiltered.png
i want to show 4 countries above selected country in horizontal view.

if i choose MALAYSIA as the country..

the result should be like this

United Arab EmiratesHongKongLuxembourgEgyptMalaysia
5.115.105.035.034.91

 

Thanks for your help.

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @aizamkamadin ,

 

Here's my solution.

1.Create an index column in the power query editor.

vstephenmsft_0-1661247080441.png

vstephenmsft_1-1661247120937.png

 

2.Create a country name table using dax. It is used for the slicer.

Table 2 = DISTINCT('Table'[Country_Name])

vstephenmsft_2-1661247210096.png

 

3.Create a visual-level measure for filtering.

Measure = var _sel=CALCULATE(MAX('Table'[Index]),FILTER(ALLSELECTED('Table'),[Country_Name]=SELECTEDVALUE('Table 2'[Country_Name])))
return IF(MAX('Table'[Index])>=_sel-4&&MAX('Table'[Index])<=_sel,1)

 Put it into the visual level filters, set up show items when the value is 1.

vstephenmsft_3-1661247431877.png

 

Best Regards,

Stephen Tao

 

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

 

 

thanks for sharing your solution..

but sorry i cant use ur solution, because it need manually key-in the index
fyi i have 132 country multiply with 81 indicators..

 

tmrow i'll share my current solution..its not perfect yet.. but it can filter out the above country automatically using data format..

 

 

Hi @aizamkamadin ,

 

Any update?

 

Best Regards,

Stephen Tao

Hi @aizamkamadin ,

 

Or you could try to create the index by dax.

Here's the method in this post:

Solved: Index in DAX - Microsoft Power BI Community

 

 

Best Regards,

Stephen Tao

 

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

 

amitchandak
Super User
Super User

@aizamkamadin , In a matrix visual. Do not use Row. Use column on Country.

 

If needed use option- Switch Values to row

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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