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! It's time to submit your entry. Live now!
My SWITCH statement works properly but I need to RANK the results within a Heirarchy. I have Territory_Managers and then Salespeople grouped below them. How do I rank each group of salespeople within their territory.
Solved! Go to Solution.
output :
ranking =
var datasource =
CALCULATETABLE(
SUMMARIZE(
table_1,
table_1[territorymanager],
table_1[salespeople]
),
REMOVEFILTERS(table_1[salespeople])
)
var r =
RANK(
,
datasource,
ORDERBY([total sales] , desc )
)
return r
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅!
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
output :
ranking =
var datasource =
CALCULATETABLE(
SUMMARIZE(
table_1,
table_1[territorymanager],
table_1[salespeople]
),
REMOVEFILTERS(table_1[salespeople])
)
var r =
RANK(
,
datasource,
ORDERBY([total sales] , desc )
)
return r
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅!
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
It was my FORMAT that was making the difference. Unsure why my % via FORMAT was different then just marking the SWITCH as a %. Maybe it was a text string?
Thanks
thank you! It's working....mostly. It works fine for anything < 100%. Any idea why anything over would throw it off and do you have a solution?
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 35 | |
| 24 | |
| 22 |
| User | Count |
|---|---|
| 134 | |
| 107 | |
| 57 | |
| 43 | |
| 38 |