Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi
I would like to visualize the top 4 including the one selected item from the same group or category.
For example, the top 4 countries and their population including the country that is selected in the slicer. this compares the other 4 countries with the highest population with the selected country in the same region.
While I can get the top 4 and rank it, I am not sure how I can get the selected country in it as well.
Hi @Sage2019 ,
first create a un-connect table for the slicer:
and then please create a new measure for the visual's filter:
Filter =
VAR __ranking = RANKX(ALLSELECTED('Table'[Country]),[Total Population])
VAR _select_value = ALLSELECTED('DimCountry'[Country])
VAR _result = IF(__ranking<=4 || SELECTEDVALUE('Table'[Country]) IN _select_value,1)
RETURN
_result
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
Hello @Sage2019
can you please share a sample data and the output of what you want to achieve ?
best regards,
Country | Region | Population |
A | North | 500,000 |
B | North | 460000 |
C | North | 80000 |
D | West | 240000 |
F | West | 390249 |
G | East | 94239 |
H | West | 139403 |
I | East | 293131 |
J | North | 60000 |
my country slicer is a field in the Dim Country Table that is connected to my Population table.
The results I want to achieve is if I single select J as the country I should see J in the visual along with the top 3 or 4 countries in the same region North. Therefore the visual should have A,B and J if it's the top 3 or A,B,C and J if top 4
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
91 | |
84 | |
76 | |
65 |
User | Count |
---|---|
145 | |
109 | |
109 | |
102 | |
96 |