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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
oldrunner
Frequent Visitor

Creating an Index number in DAX

Hi,
I need to create a column with index numbers by categories. I have for example 100 different customers and a total of 500 invoices. I need to have a unique index number per customer and invoice. So they count need to start with "1" per customer.

Using the index function in the power query editor doesn't work, it always returns an error.

 

Any help is highly apprechiated.

 

 

3 REPLIES 3
oldrunner
Frequent Visitor

Thanks,
Rankx replied with an error. I struggle to concat the customer code and sales invoice code to get a unique key.

 

Create a calculated column on your table using concatenate dax function to create a unique key. Also what is the RANKX error you're getting?

Keith_Fernandes
Advocate II
Advocate II

Try to concat customer_code and Sales_invoice_code to generate a unique key. You can then create an index on this. You can also use RANKX function to get unique count against each value. Try these workarounds.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.