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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.