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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Running occurance list appended as index

Hello, i am new to DAX

I've searched all over, but i can't find a solution to my problem.

My data is as follows:

Part number
AB
AB
1234
M4
M4
M4

I need to make an index of the running occurance of the part number, and append the count to the part number, like this:

Part number     Index
ABAB1
ABAB2
123412341
M4M41
M4M42
M4M43

The table is called 'Search file' and it has 10 columns. 

Thank you in advance to anyone who can help me out! 

1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

To add a index column in power editor and create a calculate column below:

 

Column =
[Part number]
    & COUNTAX (
        FILTER ( 'Table', [Part number] = EARLIER ( [Part number] ) ),
        [Part number]
    )

 

Result:

v-angzheng-msft_0-1618912387393.jpeg

It is important to note that the Index field does not summarize.

 

 

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

To add a index column in power editor and create a calculate column below:

 

Column =
[Part number]
    & COUNTAX (
        FILTER ( 'Table', [Part number] = EARLIER ( [Part number] ) ),
        [Part number]
    )

 

Result:

v-angzheng-msft_0-1618912387393.jpeg

It is important to note that the Index field does not summarize.

 

 

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

CTozzi
Resolver I
Resolver I

Hi @Anonymous , I would create the Index in Power Query following this https://www.youtube.com/watch?v=7CqXdSEN2k4

 

In Summary:

  1. Group by Part Number
  2. Insert custom column with Index: Table.AddColumn(#"Grouped Rows", "Index", each Table.AddIndexColumn([Group], "Index", 1, 1))
  3. Expand Index
  4. Make sure both columns have the same type
  5. Concatenate PartNumber & Index
  6. Remove unnecessary columns

(I can attach a sample file when I figure out how to do it 🙂 )

amitchandak
Super User
Super User

@Anonymous , Add an index column  https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi

 

and create a column in dax

[Part number] & countx(filter(table, [index] <=earlier([index]) && [Part number] = earlier([Part number])),[Part number])

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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