Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
chaichatp
Helper III
Helper III

Index Column based on 2 columns while 1 column include some duplicated values

I already tried RANKX but didnt find out the right way.

 

Capture.PNG

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

@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.


Please @mention me in your reply if you want a response.

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

View solution in original post

5 REPLIES 5
AllisonKennedy
Super User
Super User

@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.


Please @mention me in your reply if you want a response.

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. 🙂 


Please @mention me in your reply if you want a response.

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

amitchandak
Super User
Super User

@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-...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you. Let me try.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.