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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors