Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone, I would like to receive some assistance please.
Please click on the link below to access my current PBI working file
Background
I received help with creating a new measure (see DAX code below) that calculates the rank of each reported response (with some specific responses being excluded) based on the number of times that it appears in the data.
Additionally, I would like to have a 6th (and final) row in the table (below each of the top 5) that is for 'All other responses' and also displays the combined number of responses (for all responses that are ranked from 6 and below).
Solved! Go to Solution.
Hi @misterlau14 ,
Please check whether this is what you want:
First I use this DAX to create a calculated table:
TopOccupationsTable =
UNION(
ADDCOLUMNS(
FILTER(
VALUES('ALL Arrivals data'[Occupation]),
[Rank_Occupation_v2] <= 5 && [Rank_Occupation_v2] <> BLANK()
),
"Rank", [Rank_Occupation_v2]
),
ROW("Occupation", "All other responses", "Rank", "other")
)
Then create the Table visual with this calculated table and use this DAX to create a measure:
Count =
IF(
MAX('TopOccupationsTable'[Occupation]) = "All other responses",
CALCULATE(
COUNT('ALL Arrivals data'[Occupation]),
FILTER(
ALL('ALL Arrivals data'[Occupation]),
[Rank_Occupation_v2] > 5
)
),
CALCULATE(
COUNT('ALL Arrivals data'[Occupation]),
'ALL Arrivals data'[Occupation] = MAX('TopOccupationsTable'[Occupation])
)
)
Also put the measure into the Table visual and the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @misterlau14 ,
Please check whether this is what you want:
First I use this DAX to create a calculated table:
TopOccupationsTable =
UNION(
ADDCOLUMNS(
FILTER(
VALUES('ALL Arrivals data'[Occupation]),
[Rank_Occupation_v2] <= 5 && [Rank_Occupation_v2] <> BLANK()
),
"Rank", [Rank_Occupation_v2]
),
ROW("Occupation", "All other responses", "Rank", "other")
)
Then create the Table visual with this calculated table and use this DAX to create a measure:
Count =
IF(
MAX('TopOccupationsTable'[Occupation]) = "All other responses",
CALCULATE(
COUNT('ALL Arrivals data'[Occupation]),
FILTER(
ALL('ALL Arrivals data'[Occupation]),
[Rank_Occupation_v2] > 5
)
),
CALCULATE(
COUNT('ALL Arrivals data'[Occupation]),
'ALL Arrivals data'[Occupation] = MAX('TopOccupationsTable'[Occupation])
)
)
Also put the measure into the Table visual and the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks heaps for your help, very much appreciated 🙂
Hi,
I have answered a similar question in the attached files. Please study these example files and apply these measures to your dataset.
Hope this helps.
Thank you for attaching those two sample PBI files in your reply, they did assist me with obtaining the output I was looking for
You are welcome.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |