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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.