Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi. I have a bunch of satisfaction data. it covers various Sites and Category, and what I need to do is calculated a ranking value for each Site, based on how its score compares to other Sites in the same Category.
Example Data below - "Site Category Rank" is what I'm trying to calculate.
Site | Category | Score | Site Category Rank |
New York | Customer Service | 75 | 1 |
London | Customer Service | 65 | 2 |
Paris | Customer Service | 59 | 3 |
Munich | Customer Service | 15 | 4 |
New York | HR | 65 | 3 |
London | HR | 52 | 4 |
Paris | HR | 85 | 1 |
Munich | HR | 75 | 2 |
I have a rough ideas of what I need to do - for each cell generate a table of all the sites with their scores, filtered to just the category of the row, get the rank position of the site on that table, but the actual implmentation is eluding me.
This is basically (I think) the same as is described in this post from 2019 : https://community.powerbi.com/t5/Desktop/DAX-Ranking-data-based-on-multiple-categories/m-p/672427#M3...
but "porting" that DAX over to my file doesn;t seem to work - there's clearly something important I'm missing.
I do have a column that's unique for each row, It's a concatenation of the site and category so every row's value is unique, though it won;t let me set that column as the key value for the table.
Don't know why it wouldn't if the values are unique, but you can just use Power Query to add an index column.
You need a column which can uniquely identify each row. If you don't have one already you can use Power Query to add an index column. In the modelling view, mark that column as the key column for the table, and then you can use
Site Cat Rank Measure =
RANK( SKIP, ALL( 'Table' ), ORDERBY( 'Table'[Score] , DESC), PARTITIONBY( 'Table'[Category]))