Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I would like to making index key for my product in table visualization. My table look like this
| UniqProductID | ProductName |
| 156 | A |
| 156 | A |
| 964 | B |
| 789 | C |
| 789 | C |
I using this dax in my measure
| Index | UniqProductID | ProductName |
| 1 | 156 | A |
| 1 | 156 | A |
| 2 | 964 | B |
| 3 | 789 | C |
| 3 | 789 | C |
| Index | UniqProductID | ProductName |
| 1 | 156 | A |
| 1 | 156 | A |
| 2 | 789 | C |
| 2 | 789 | C |
So, Index field will be dynamic per filter selection. How to write dax as per expected result.
Thank you.
EDITED
Hi @Supakit_1
Try this measure:
index =
RANKX (
ALLSELECTED ( tblProduct ),
CALCULATE (
MAX ( tblProduct[ProductName] ),
ALLEXCEPT ( tblProduct, tblProduct[ProductName] )
),
,
ASC,
DENSE
)
Output:
You can also download the file: https://gofile.io/d/4JJQpK
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos✌️!!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |