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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jrobles
Regular Visitor

add numerical correlative

hi, i need to add a new column with running count, based on existing columns. How do I generate the ID column?

 

FORMATOPRODUCTO ID
A892484 1
A895524 2
A1057696 1
A1057696 2
A1057696 3
A1057698 1
B1049710 1
B1049710 2
B1047274 1
B1047274 2
B1047274 3

 

I need to add a unique id in each repeated value

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

The answer in the second row should be 1.  You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
jrobles
Regular Visitor

thanks, they are the best

gracias, son los mejores, los mas pulentos

 

Ashish_Mathur
Super User
Super User

Hi,

The answer in the second row should be 1.  You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@jrobles , First of all, add an index column in power query and then try this as a new column in DAX -https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

countx(filter(Table, [FORMATO] = earlier([FORMATO]) && [PRODUCTO] = earlier([PRODUCTO]) && [Index] <=earlier([Index]) ),[Index])

AllisonKennedy
Super User
Super User

@jrobles  Is this what you're looking for? https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query 


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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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