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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Boycie92
Resolver I
Resolver I

Direct Query Identify Duplicates

Hi

 

I am wondering if someone can help,

 

I have a column that has duplicate values I want to create a calculated column that will count the 1st one and not the second

 

So first = 1

Any other = 0

 

I have a direct query model and as a result I’m am not able to add an index in the query editor.

 

If I was I would use a calculation like this

DupsID = IF('Reports'[Index]=MAXX(FILTER('Reports','Reports'[UniqueID]=EARLIER('Reports'[UniqueID])),'Leavers Reports'[Index]),"1","0")

 

Is there anyway first on all to add an index using DAX?

 

Also would I then be able to use the above DAX or somthing similar to be able to identify the duplicates?

 

Thanks in advance,

Boycie92

1 REPLY 1
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @Boycie92,

If there is any other column in your resource table to identify the first or second row? If you want to add index through, you need to a column which can be compared like the [Avg-Position] column in this case. Otherwise, I can't figure out an feasible solution.

Best Regards,
Angelia

Helpful resources

Announcements
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.