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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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