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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Viraj16Agate
Regular Visitor

Duplicates, indexing

Hi All,

 

I am trying to index a particular column based on re-occurance of same values (Region), can anyone please suggest solution for below

 

I have following data sample

Region    Value

A             1000

B             500

C             2000

A             1000

D             2500

E             1500

 

I need solution as in following format

Region    Value      Regionoccurance

A             1000       1

B             500         1

C             2000       1

A             1000       2

D             2500       1

E             1500        1

 

Thanks in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Viraj16Agate , refer to this video from Curbal, that can help. But in this you might need an index column first

 

https://www.youtube.com/watch?v=7CqXdSEN2k4

 

In dax

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

 

 

You need to create index in power query

 

 

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

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Viraj16Agate 

You can first add an index column in Power Query or in the source then add the following column to your table in the model:

Column = 
COUNTROWS(
    FILTER( Table4 , Table4[Region] = EARLIER(Table4[Region]) && Table4[Value] = EARLIER(Table4[Value]) && Table4[Index]  <= EARLIER(Table4[Index] ))
)

 

Fowmy_0-1631518594533.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@Viraj16Agate , refer to this video from Curbal, that can help. But in this you might need an index column first

 

https://www.youtube.com/watch?v=7CqXdSEN2k4

 

In dax

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

 

 

You need to create index in power query

 

 

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.