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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
@chaichatp If you're just looking for an index column, you can also create in Power Query. This blog has more than you need, but the first bit is on simple Index: https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
What is your data source? The sort in Power Query sometimes requires a Table.Buffer step before or within the index, but after the sort.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@chaichatp If you're just looking for an index column, you can also create in Power Query. This blog has more than you need, but the first bit is on simple Index: https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
What is your data source? The sort in Power Query sometimes requires a Table.Buffer step before or within the index, but after the sort.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
That's what I was looking for. Thanks so much.
@chaichatp You're very welcome. Glad it worked. 🙂
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@chaichatp , You can use RankX with breaking ties. Mentioned in
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Breaking-Ties-in-Rankings-with-RANKX-Using-Multiple-...
Thank you. Let me try.