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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AP_S
New Member

How to assign similar groupids and mark duplicate based on multiple columns with same records

Hi Folks,

 

I am not sure how do i asiign same groupids to the rows that have same values across multiple column and also if possible add a flag for duplicacy. So I have a table that looks like below:

UniqueIDInvNumberInvCompInvRefrenceInvGrossAmount
1INV1234121Test203.12
2INV1234121Test203.12
3INV567872Pass677777
4INV1123234Loan23070
5INV567872Pass677777

 

In the same table, I want to add an additional column to assign the same groupID wherever the values for the below column are same. 

InvNumberInvCompInvRefrenceInvGrossAmount

 

After adding the columns the desired table should look like below: Line 1 and 2 have the same value across an hence have the same groupid and flag as TRUE for duplicacy.

UniqueIDInvNumberInvCompInvRefrenceInvGrossAmountGroupIDDuplicate
1INV1234121Test203.121TRUE
2INV1234121Test203.121TRUE
3INV567872Pass6777772TRUE
4INV1123234Loan230703FALSE
5INV567872Pass6777772TRUE

 

Is there a way I can achieve the above using DAX query only. The connection for the powerbi file is going to the Diret query mode and hence, appreciate any solution that will work for direcy connection.

1 REPLY 1
amitchandak
Super User
Super User

@AP_S , Create a Rank

 

Group ID = Rankx(Table, Table[InvNumber], ,asc,dense)

 

Duplicate = 

if(countx(filter(Table, [InvNumber] = earlier([InvNumber]) ),[InvNumber]) +0 >1, True(), false())

 

 

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.