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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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โ๏ธ!!
Check out the November 2025 Fabric update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!