Forum Discussion
Ranking Project Items by Size
How would I rank the following project IDs by these two categories? Small Projects and Large Projects. Project IDs with XXS - S are grouped into the Small category. Projects with M - XXXL are grouped into the Large category. I'm wondering how best to execute this in DAX...
| ID | Project size |
| 1 | XXXL |
| 3 | L |
| 6 | S |
| 8 | M |
| 25 | L |
| 57 | XS |
| 77 | L |
| 81 | |
| 98 | |
| 100 | |
| 127 | S |
| 136 | M |
| 137 | M |
| 162 | L |
| 165 | S |
| 166 | L |
| 174 | S |
| 188 | S |
| 189 | XS |
| 190 | L |
| 191 | M |
| 193 | XS |
| 197 | S |
| 198 | XS |
| 200 |
You can use a calculated column :
Project Size Group = IF([Project size] in {"XXS","XS","S"}, "Small", "Large")(note, this can be done in PowerQuery as well, although with a different formula; you can access the instructions here: https://support.microsoft.com/en-au/office/add-a-conditional-column-power-query-f2422ed1-f565-4e64-ba3f-4f8d4616254e)
2 Replies
- vicky_Super User
You can use a calculated column :
Project Size Group = IF([Project size] in {"XXS","XS","S"}, "Small", "Large")(note, this can be done in PowerQuery as well, although with a different formula; you can access the instructions here: https://support.microsoft.com/en-au/office/add-a-conditional-column-power-query-f2422ed1-f565-4e64-ba3f-4f8d4616254e)
- Alta88Helper IV
Thanks, Vicky! This works well! Follow up question: what if I wanted to display the top 3 for both of those categories (Large vs. Small)?