Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I am currently stuck on a problem with a Power BI file that I have created --> Testing file
Background of file
Within the file, users select from 2 different slicers:
1. Settlement Location
2. Financial Year of Arrival
Note the following points about the table I have created in the file:
My problem (that I would like to solve)
I would like to create a separate table with 6 rows for the variable Client Citizenship (with the same structure as seen in the Excel screenshot below)
I can do this in Excel with no issues but currently do not understand how to implement this same table in Power BI.
I will be most grateful for any assistance - please make any required updates to my attached Power BI file --> Testing file
Thanks heaps
Solved! Go to Solution.
Update: I managed to find the solution to my problem
In case it helps anyone else who deals with something similar to my original problems - this YouTube video solved everything for me (it's 36 mins long but the narrator talks at a pretty good pace so that you can follow along) - https://youtu.be/nVvlEHKr_0o?si=WLSoFLSFE5qZgMYV
Update: I managed to find the solution to my problem
In case it helps anyone else who deals with something similar to my original problems - this YouTube video solved everything for me (it's 36 mins long but the narrator talks at a pretty good pace so that you can follow along) - https://youtu.be/nVvlEHKr_0o?si=WLSoFLSFE5qZgMYV
Hello @misterlau14,
We appreciate your effort and are glad to hear that your issue has been resolved. Your update will also help other community members address similar issues more efficiently.
Hi — this is a classic Top N + “Other” scenario, and you’re actually very close already since you’ve built the ranking measure 👍
The missing piece is creating a grouping logic that separates Top 5 vs everything else, while still respecting slicers.
Step 1: Create a grouping measure (Top 5 vs Other)
You can build a measure like this:
Citizenship Group =
VAR RankVal = [CC_Ranking1]
RETURN
IF(
RankVal <= 5,
SELECTEDVALUE('Table'[Client Citizenship]),
"Other"
)
Step 2: Create a measure for counts
Now calculate your values using this grouping:
Count Grouped =
CALCULATE(
COUNTROWS('Table'),
ALLEXCEPT('Table', 'Table'[Client Citizenship])
)
(Adjust this depending on how you're currently counting occurrences — reuse your existing measure if you already have one.)
Step 3: Use in a Table Visual
Rows → Citizenship Group
Values → your count measure
This will:
Show Top 5 individually
Automatically group everything else into “Other”
Still respect both slicers (Settlement Location + Financial Year)
⚠️ Important Note
Measures alone can sometimes cause duplicate “Other” rows depending on context.
If that happens, a more robust approach is to:
Create a disconnected table with values: Top 1–5 + “Other”
Then map your ranking into that table using measures
But in many cases, the measure-based approach above works fine.
💡 Big Picture
What you’re doing here is essentially recreating what Excel does easily with grouping — but in Power BI, you need to explicitly define that logic through measures or model structure.
Once set up, though, it becomes dynamic and slicer-aware, which is where Power BI really shines.
Hi there @donbuser ,
Thanks very much for the helpful tips in your reply.
I followed Steps 1, 2 and 3 as you mentioned.
I now have a table visual that displays each of the top 5 ranked responses (which is perfect).
Unfortunately, I do now have duplicate rows of 'Other' appearing in the table visual. I do see the points you mentioned about needing to create a disconnected table to get around this issue.
I think my brain is just stomped at the moment - can I please ask a big favour of you (which is to open the file that I have linked below and implement the updates you suggested)?
https://drive.google.com/file/d/1FpWc84iaez_pvX3Uh4lrapVO8MnDWvDj/view?usp=sharing
Thanks
Please make your file public.
Hi,
I have saved the testing file to my Google Drive (you should be able to access it via the link below)
https://drive.google.com/file/d/1pHmk2eaIdew3YSh7gLPXjbWizthPNOdM/view?usp=sharing
Thanks
The link requires a permission
Apologies about that, I have updated the settings in Google Drive so that anyone with the link to the file can now view.
https://drive.google.com/file/d/1pHmk2eaIdew3YSh7gLPXjbWizthPNOdM/view?usp=sharing
I hope you can access the file now, please let me know if you still can't.
Thanks
Hello @misterlau14
Create a small TopN table for slicer
TopN_Selection = DATATABLE("TopN", INTEGER, {{3},{5},{10}})
Capture selection
Selected_TopN = SELECTEDVALUE(TopN_Selection[TopN], 5)
Ranking
CC_Ranking1 =
RANKX(
ALLSELECTED('Table'[Client Citizenship]),
[Total_Count],
,
DESC
)
Grouping
Citizenship_Group =
IF(
[CC_Ranking1] <= [Selected_TopN],
SELECTEDVALUE('Table'[Client Citizenship]),
"Other"
)
Final_Count =
VAR TopN = [Selected_TopN]
RETURN
IF(
[CC_Ranking1] <= TopN,
[Total_Count],
CALCULATE(
[Total_Count],
FILTER(
ALL('Table'[Client Citizenship]),
[CC_Ranking1] > TopN
)
)
)
Use Citizenship_Group in rows and Final_Count in values you’ll get dynamic Top N + one “Other” row working with both slicers.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 33 | |
| 31 | |
| 29 |