Forum Discussion
Anonymous
5 years agoNot applicable
Need help to rank non numeric data
I have recently stated working on power bi and I'm struggling with this below mentioned scenario. your help will be appreciated 🙂 I wanted to rank some non character data in power bi using a measure. if there are two product id matched to one type it should rank them in alphabetical order.
can you guys help -> amitchandak Fowmy AllisonKennedy lbendlin
Data :
| Product Id | type |
| 11456 | A |
| 11456 | B |
| 11457 | A |
| 11458 | A |
| 11458 | B |
| 45821 | B |
Output
| Product Id | type | Rank |
| 11456 | A | 1 |
| 11456 | B | 2 |
| 11457 | A | 1 |
| 11458 | A | 1 |
| 11458 | B | 2 |
| 45821 | B | 1 |
- You can try this as a calculated COLUMN:
Rank Dax = RANKX(FILTER(ALL('Table'), 'Table'[Product Id] = EARLIER('Table'[Product Id])), 'Table'[type],,ASC)
7 Replies
- AllisonKennedy
Community Champion
You can try this as a calculated COLUMN:
Rank Dax = RANKX(FILTER(ALL('Table'), 'Table'[Product Id] = EARLIER('Table'[Product Id])), 'Table'[type],,ASC)- AnonymousNot applicable
getting error as parameter is not of correct type in earlier function
- AllisonKennedy
Community Champion
are you doing as calculated column or measure? What is the exact error message you're getting?